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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

solution on restricting single country users while dynamic RLS is applied on country table

My scenario needs to implement organizational hierarchy level access in premium capacity.

I have Test database in Vertica DB where 9 levels of managers hierarchy table been pulled into a direct query.

I need globally all sales rep to need to see their country data except managers need to see all.

Country[CountryKey] = LOOKUPVALUE( its not working in DQ)

           'Security'[CountryKey],

           'Security'[EmailAddress],USERPRINCIPALNAME(),

                   'Security'[CountryKey],Country[CountryKey]

         )

Suddenly ex -USA users to be blocked, again do I need to create role -Country=”USA” and assigning the set of reps to it will it work? Bcoz these reps also part of above dynamic filter by country. In this Case, can I go country wise distribution list and remove USA Distribution list.

I have seen scenarios implemented with path /path contains /lookup values in import method but not same will work on DQ though I enabled allow restricted measures lookup value doesn’t work is there any alternative how to make it work in DQ mode.

 

Waiting for valuable solution

 

DQ.PNG

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

For you scenario, you could try "IF", "SWITCH", "RELATED" function in direct query mode.

 

we can use the function "LOOKUPVALUE" to create measures after going to File -> Options and settings -> Options - > DirectQuery and enable the option “Allow unrestricted measures in Direct Query Mode”.

 

Best Regards

Maggie

 

 

 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.