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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
RicardoV2
Frequent Visitor

RLS - DAX/Structural doubt - How to properly implement this RLS Role?

Hello,

I'm importing an Excel file to my PBIX, to implement RLS. The idea is GlobalUsers like 3 and 4 (belonging to ICC_GI and ICC_GR AD groups) to  have access to everything, while SpecificUsers (from ICC_G1 AD Group) like 1 can only have access to India/CT1 and KL/CT1 and user 2 like China/CT1 and Singapore/CT2.

 

RicardoV2_1-1719941419456.png

 

The resulting table is called UserPermissions, and it is connected to factual factResults through the sk/fk_Location_CTs
(Relationship is n:n, as keys will be repeated, but direction is offcourse from UserPermissions to the factual)

So, for the implementation of the role I'm using the following DAX, which is working correctly for ICC_G1 users with specific access, 
but for the ICC_GI and ICC_GR users it isn't working 100% as I would like. I've noticed that, for these GlobalUsers, all the existing specific relationships are made available, which in this case would mean that GlobalUsers will have access India/CT1, KL/CT1, China/CT1 and Singapore/CT2. This for me might create a problem if a combination of Location and Campaign Type exists only on the factual (because UserPermissions are still being constructed on Excel 😞 ), GlobalUsers can't get access to these entries.

So, though understanding what I ask is questionable (as well as having a fact table without all relationships to dim UserPermissions in place), I ask is if it's possible to simply make all factResult entries available to GlobalUsers?

 

 

VAR CurrentUser = USERPRINCIPALNAME()

RETURN
    IF(
        LOOKUPVALUE(UserPermissions[AD Group], UserPermissions[User], CurrentUser) IN {"ICC_GI", "ICC_GR"},
        TRUE(),
        IF(
            LOOKUPVALUE(UserPermissions[AD Group], UserPermissions[User], CurrentUser) = "ICC_G1" &&
            UserPermissions[User] = CurrentUser,
            TRUE(),
            FALSE()
        )
    )

 

 

RicardoV2_2-1719942396911.png

Thanks in advance

2 REPLIES 2
RicardoV2
Frequent Visitor

Hello @Anonymous , thanks for suggesting but it doesn't work.
As a condition this can only return true or false, but again, as this enables all existing and valid relationships, only the (all) existing specific relationships will be enabled.

 

RicardoV2_0-1719999764086.png

 

Anonymous
Not applicable

Hi, @RicardoV2 

Maybe you can try the following DAX:

VAR CurrentUser = USERPRINCIPALNAME()

RETURN
    IF(
        LOOKUPVALUE(UserPermissions[AD Group], UserPermissions[User], CurrentUser) IN {"ICC_GI", "ICC_GR"},
        ALL(factResults),
        IF(
            LOOKUPVALUE(UserPermissions[AD Group], UserPermissions[User], CurrentUser) = "ICC_G1" &&
            UserPermissions[User] = CurrentUser,
            TRUE(),
            FALSE()
        )
    )

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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