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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vijay27316
Frequent Visitor

RLS DAX - HELP

Hi Team,

 

I'm trying to apply RLS using USERPRINICPALNAME() in Customers table.

User Security table looks like below....

vijay27316_1-1672261612863.png

 

Above security table is related with CUstomers table based on CITY column.

However, some user don't have city, I need to show all city of USA, eg: ALEX and Global means all Country.

 

How to setup this RLS using USERPRINCIPALNAME ?

 

Tried below DAX code and use this to get ouput of selected country for login_user's 

You can see measure shows correct data as "Germany."UK"

But when I use this measure inside Customers table filter for Country, It not applying RLS ?

vijay27316_0-1672261593776.png

 

1 REPLY 1
v-xiaotang
Community Support
Community Support

Hi @vijay27316 

Thanks for reaching out to us.

please refer to this tutorial,

Row-level security (RLS) with Power BI - Power BI | Microsoft Learn

vxiaotang_1-1672309892747.png

Row-level security (RLS) guidance in Power BI Desktop - Power BI | Microsoft Learn

vxiaotang_0-1672309826697.png

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.