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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

DAX Expression for Row Level Security

Help – I have the following tables.

FUFPermission is a list of users and the area they can have access to.

FUFPermission

Username

Area

b@b.co.uk

Back

c@c.co.uk

Front

c@c.co.uk

Side

d@d.co.uk

Side

e@e.co.uk

All

 

AFU is a table containing the Area

AFU

  

Area

anotherifeld

anotherfield1

Back

1

4

Front

2

5

Side

3

6

 

I need to create a DAX formula for the AFU table to filter the Area based on user on the FUFPermission table.  If the FUFPermission.Area = All then the user will have full access to all records  in AFU.

I have created the following DAX formula which filters the Area based on the FUFPermission table but I’m not sure how to include the part which shows all records if the Area value = All in FUFPermission.

IF

(

[Area] IN SELECTCOLUMNS (

FILTER (

'FUFPermission',

''FUFPermission' [Username]=USERPRINCIPALNAME()

),

Area,[Area]

),

TRUE()

)

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try:

VAR _a =
    SELECTCOLUMNS (
        FILTER ( 'FUFpermission', [Username] = USERNAME () ),
        "Area", [Area]
    )
RETURN
    IF ( "All" IN _a, TRUE, [Area] IN _a )

vjianbolimsft_0-1662518295161.png

Final output:

vjianbolimsft_1-1662518316845.png

vjianbolimsft_2-1662518341589.png

Best Regards,

Jianbo Li

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-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try:

VAR _a =
    SELECTCOLUMNS (
        FILTER ( 'FUFpermission', [Username] = USERNAME () ),
        "Area", [Area]
    )
RETURN
    IF ( "All" IN _a, TRUE, [Area] IN _a )

vjianbolimsft_0-1662518295161.png

Final output:

vjianbolimsft_1-1662518316845.png

vjianbolimsft_2-1662518341589.png

Best Regards,

Jianbo Li

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

 

 

 

Anonymous
Not applicable

Thanks for the response - not sure if this woud work as there is no physical relationship between the tables FUFPermission and AFU.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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