cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Power BI - Using DAX, how can I check which Role (from Row Level Security) the user is using?

Hi,

I have created four Roles (Full Company, North, South East, and South West) via Row Level Security. The way this RLS will be implemented is by assinging the user email address (userprincipalname) in the Power BI Service against the Role. When a user logs in using their userprincipalname the correct Role will be assigned to the user and thus they can only see their granted data.

I would like to know if there is a way, using DAX, to check which Role name (i.e. Full Company, North, South East, or South West) is being used - what would be the DAX to achieve this?

My aim is to provide a tailored message, via a card or another visual, that will instruct the user based on the role being used. For example, is the North Role is being used when viewing the report then a message like "This North region will show you.....", or if the South East Role is being used a message like "The South East region incorporates...".  I suspect a Switch function will be require but the key thing is using DAX to check which Role is being used by the user.

Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @judspud - thanks for your response but I have it all sorted now.
I was overthinking it. I simply used the SELECTEDVALUE function on the table that the Role (RLS) was applied against.

 

 

View solution in original post

2 REPLIES 2
judspud
Solution Supplier
Solution Supplier

Hi @Anonymous 

 

How are you implementing the RLS? i.e. which table/field are you using to filter the data?

 

Also, can a user be part of multiple roles?

 

Thanks,

George

Anonymous
Not applicable

Hi @judspud - thanks for your response but I have it all sorted now.
I was overthinking it. I simply used the SELECTEDVALUE function on the table that the Role (RLS) was applied against.

 

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors