Row level security in Power BI using USERNAME()

peejay

Board Regular
Joined
Jul 11, 2003
Messages
83
Hi
I'm having some trouble implementing row level security in a simple Power BI model. I'm using an SS Tabular cube for my data (Visual Studio 2010), and implementing the security in it via a Role.

My model has a data table, which includes a User Name column, and a UserName table (with just a User Name column).
I want my dashboard to only return records from the cube for the user logged in, getting their username via the UserName() function.

I have set up a role (anyone can access the PBI model with reader access), with a DAX formula on the UserName table, which is =tblUserName[User Name] = Username()

I interpret this to mean... select the record(s) - if any - in the tblUserName table's User Name column which matches the UserName(), and only return those records from the data table which have this selected User Name in it's own user name column.

I think this is OK however my test user doesn't get any records returned. They can access the Power BI model and it appears OK; the problem is no data is returned.

Have I something fundamentally wrong in this approach? If not, then I need to follow some other path to resolve this. Thx in advance.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top