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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
skhalatian
Frequent Visitor

Row Level security

Hi

This is a test scenario and I’m having the following issue

I have two tables

 

Users (with two columns)

Username                           Region Name

--------------                          -------------------

[email protected]                            Seattle

[email protected]                             San Diego

 

 

Regions (with two columns)

Region Name                     State

------------------                    ------------------

Seattle                                  WA

San Diego                            CA

 

Row level security has been configured with filtering [Username] = USERPRINCIPALNAME()  From users table.

I have the following Measures

_USERPRINCIPALNAME = VALUES(Users[Username])

_USERPRINCIPALNAME Region = if(HASONEVALUE(Users[Region Name]),VALUES(Users[Region Name]),"single Region must be selected")

And following calculated column on Region

Filter Region = if(Regions[MarketName]=[_USERPRINCIPALNAME Region],1, 0)

 

if I view report as role [email protected]

_USERPRINCIPALNAME will be populated as [email protected]

_USERPRINCIPALNAME Region will be populated as Seattle

However Filter Region will always return 0. I was expecting for San Diego to return 1 and for all other regions to return 0

 

 

  image.png

 

Thanks

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @skhalatian,

 

Based on my test, here we need to create the Filter Region as a measure and update the formula as below.

 

 

Filter Region = if(MAX(Regions[MarketName])=[_USERPRINCIPALNAME Region],1, 0)

 

Then we can get the result as we excepted.

 

Capture.PNG

 

Regards,

Frank

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

That is a perfect suggestion however I need to use the Filter Region on the page/report level

if I use a measue I can not use that as  page/report filter ( it has to be calculated column or column)

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.