0
votes

I am trying to build a page where it returns table for the logged in user. And then you can use the filter to look at other users records .

User = USERPRINCIPALNAME()

I am having problems filtering the table for the logged in user . Without using row level security with data model changes like below . Is there a way for the Power BI table to return data just for the logged in user ? No SSAS involved.

https://medium.com/@barrasa8/dynamic-data-masking-in-powerbi-based-on-rls-927eb6a34e5d**strong text**

The data model is a FACT table linked to a USER dimension. In the User Dimension , there is an email address which is what the USERPRINCIPALNAME() resolves to.

I thought about a DAX summary table with summarise and may try that later . Then 2 buttons on the page , one to show current logged in user and the other button just gives you details about all other users data and work with all the filters on the page .

So basic want is

Logged In User : X

Table - Col 1 , 2 ,3 .... ( Filtered for User x only by default )

Then I would like a way for the logged in user then to see others user data easily.

1

1 Answers

1
votes

Unfortunately there is no way to use USERNAME() or USERPRINCIPALNAME() in DAX measures.

What you're left with is using row level security but that would mean it'll not be possible to show the data of other users.

The best alternative I can think of is to load the data twice. Then set Row Level Security on one table, display that one as "Your data", don't use RLS on the second table and display that as "Other people's data". Put them side by side for easy comparison.

I just wrote a blog post about a similar challenge on how to make sure you can still filter both tables: https://www.linkedin.com/pulse/calculating-totals-row-level-security-using-powerbi-van-der-pasch