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
Matti
Frequent Visitor

Row level security and permission to view 'All'

Hello,

 

Using the following blog post I've been seting up Dynamic RLS.

Different approach to Dynamic Row Level Security

 

So far everyone has a seperate row in the security table for each department or country that they have permission to view. However, for user who should be allowed to view all countries or all departments this creates a inconvenience, given that the company has a lot of departments and countries, and as such would require a long security table.

 

Is there anyway to give users permission to all departments or countries without listing the user and all departments in the security table? Preferably i could just write 'All' in the security table and PBI would then read the entry as equal to all departments.

 

See the picture below for an simple illustration of what i am looking for.RLS.PNG

 

 

 

 

1 ACCEPTED SOLUTION

@Matti,

 

You may replace "All" with a blank space, and note the logical OR operator (||) in the formula.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@Matti,

 

You may add a CONTAINS Function.

CONTAINS (
    Table1,
    Table1[Email], USERPRINCIPALNAME (),
    Table1[Department], "All"
)
    || 
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Matti,

 

You may replace "All" with a blank space, and note the logical OR operator (||) in the formula.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Hi v-chuncz-msft,

 

My problem is that we don't have a department hierarchy with 'All' on the top, so Power BI won't recognize 'All' as something recognizable in the department dimension. The hierarchy is flat so to speak, so it's just department 10, 20, 30..., 90. Other than that, I think the code in the blog post that I link to does somewhat the same as what your code suggests?

 

I need to know if there is anyway to make Power BI give access to all departments. I originally hoped leaving a blank space "" instead of "All" in the security table would work.

 

NOT(ISBLANK(LOOKUPVALUE(security_mapping[CATEGORY],security_mapping[CATEGORY],[Category],security_mapping[USER],USERNAME())))

 

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.