Row level security in Power BI using USERNAME()


Board Regular
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.

Some videos you may like

This Week's Hot Topics