Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Extract Azure AD Group Using DAX Like USERNAME() Function

Is it possible to extract a logged in Power BI user's AD group name in a similar way to how USERNAME() extracts the user name?

 

My use case for this is for row level security.  I have 3 groups of users.  Executives, Managers, and Sales Reps.

 

1.  Executives and managers can see all data

2.  Sales Reps should only see data for their accounts

 

The data architect I'm working with has put JOINS in place to only retrieve rows of data that are relevent to each Sales Rep at the database level before it reaches the data mart that will be my primary source of data.

 

How can I expose all the client data for Executives and Managers, while limiting Sales Reps data to their own clients?

 

I have considered the Radacad solution, but am hesitant to constantly manage who is a manager with a 'IsManager' flag since there may be hundreds and maintaing that list will be cumbersome.

 

If I can extract the AD Group name I can limit or expose the data that is needed by the AD Group.

 

Any thoughts or ideas are appreciated!  Thank you community!

 

 

3 REPLIES 3
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

By tests, I'm afraid that we may not use DAX expressions to extract Azure AD group currently in Power BI.

 

If you want to configure the RLS for group, you could type in security group or distribution list when you add members in Power BI Service.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

The problem I'm trying to solve requires I know what group the user is in before the full execution of the query.

Anonymous
Not applicable

I'm going to use a different approach.  Thanks for your help. Maybe this will be a future feature.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.