Forum Discussion
Filtering data for customers with embedded Power BI with a shared data source?
- 9 years ago
- IanV9 years agoFrequent Visitor
Yes, I did look at that. From what I could tell, though, it looked like a role would need set up for every customer with every associated user (they'd also need removed as customers' staff turn over). This is fine for a small number of customers, but it doesn't seem like it would be easily maintainable as business grows.
Also, would this need set up on a report-by-report basis? If so, then that compounds the issue of maintenance.
Are there alternatives to managing RLS manually through Power BI desktop? Is role/rule setup available through the SDK?
I'm pretty new to all of this, so let me know if I'm wildly off-base here. I'm also open to utilizing other types of data sources, if there are better solutions. For example, if a report could pass along user info to a REST or OData endpoint, then the data could be filtered server-side before it even makes it to the report itself.
- IanV9 years agoFrequent Visitor
Actually, ignore my last reply. After looking more into how RLS works with Power BI embedded, I figured out that I could actually pass in a CustomerId as the username on the embed token, and then use DAX with the USERNAME() function to tie that to the CustomerId on the report.
So essentially, in RLS, I have a role "Customer" with the following DAX expression:
[CustomerId] = USERNAME()
Then, I created a token with the appropriate role and username:
{ "wid":"{workspace id}", "rid":"{report id}", /* other properties */ "roles":"Customer", "username":"my-customer-uid" }I'm not sure if this is what you intended when you suggested using RLS, but it should definitely work.
- Anonymous9 years agoNot applicable
Hey IanV
Can you please tell me where am I supposed to create the token? I'm new at this and I don't understand. I read the post about power BI Embedded but I can't figure out the part with the token.
Please help me..
Thanks
- marco_comande4 years agoNew Member