3
votes

We currently host data for multiple users in our database. I'd like to implement embedded power BI into our web app. When the user logs into our system, I'd like the data source to be filtered according to the user that is logged in, so e.g. SELECT * FROM Table1 WHERE ItemID in (ItemID1, ItemID2) etc..., we aren't going to know what ItemID1, ItemID2 etc... are until after the user has logged on.

Is this possible with PowerBI embedded?

1

1 Answers

7
votes

To filter data for Power BI users based on which user is logging in to the embedded web app, complete the following:

Sample:

  1. Create a table to store the usernames for each filter "group."

  2. You will use DAX to create a measure to identify the users from your table, and assign them to a specific user role group. Below is the DAX to use:

[USERNAME] = [Current User]

Create the measure described in point #2 in the Row-Level security settings. By creating different "groups" for the users, you are essentially dynamically-building a "filter," where you only show the users what they should be seeing--thus resulting in pseudo-filtering. For more information see the following:

https://docs.microsoft.com/en-us/power-bi/desktop-tutorial-row-level-security-onprem-ssas-tabular

http://community.powerbi.com/t5/Service/Restricting-filters-to-specific-users-in-Power-BI-report/td-p/109111

Hope this helps!