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
kmaranto
Helper I
Helper I

Dynamic RLS DAX Syntax Errors - IF Function

I am trying to create a DAX expression for a Dynamic RLS design but keep receiving a syntax error.

 

The two tables used in the expression are a Users_tbl and a Permissions_Table.  The Users_tbl has a 1 : Many relationship with the Permissions Table.

kmaranto_0-1675305903910.png

 

Filters are applied based off of the values in the Permissions_Table[Senior Manager_RLS] column.

 

Several users have the word "None" listed in the [Senior Manager_RLS] column since I want those users to be able to see all data in the dashboard (no filters applied).  For everyone else, I want them to see only the levels I have assigned in the Senior Manager_RLS column.

 

I've been trying to implement an if statement to remove the filters if the Permissions_Table[Senior Manager_RLS] column contains "None" but keep receiving a syntax error on 'if' (I've tried both 'IF' and 'if' both returning the same syntax error).  Here is the complete code:

 

var temp_table = FILTER(Permissions_Table, Permissions_Table[Email]=USERPRINCIPALNAME())

if(temp_table[Senior Manager_RLS]="None",
TRUE,
[Email]=USERPRINCIPALNAME()
)

 

Any help would be much appreciated!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@kmaranto ,

try like

if(Maxx(temp_table,temp_table[Senior Manager_RLS]) ="None",
TRUE,
[Email]=USERPRINCIPALNAME()
)

 

or

 

Maxx( FILTER(Permissions_Table, Permissions_Table[Email]=USERPRINCIPALNAME()),[Senior Manager_RLS]) ="None" || [Email]=USERPRINCIPALNAME()

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
kmaranto
Helper I
Helper I

Thank you very much for the help @amitchandak .

 

I'm still learning DAX so I very much appreciate that you included both a modified version of my code in your first solution and then also added a more streamlined version with your second.

 

Strangely, when using the code from the first solution and including the variable declaration, I was still receiving a syntax error on the if function so I couldn't actually get that one to work.  I'm not sure if that's a bug or not but, for anyone finding this in the future with a similar issue, the second solution works without error.

 

Thanks again for your help!

amitchandak
Super User
Super User

@kmaranto ,

try like

if(Maxx(temp_table,temp_table[Senior Manager_RLS]) ="None",
TRUE,
[Email]=USERPRINCIPALNAME()
)

 

or

 

Maxx( FILTER(Permissions_Table, Permissions_Table[Email]=USERPRINCIPALNAME()),[Senior Manager_RLS]) ="None" || [Email]=USERPRINCIPALNAME()

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors