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

Power BI Dax - IF with calculatetable

Hello Everyone,

 

We are working on creating Dynamic RLS for one of our reports, and we are facing issues in DAX. Below is the DAX, It is working fine if we remove IF condition. But if we use IF condition with CalculateTable the results are not as expected.

 

[region] IN IF(CONTAINS(analytics_auth1, [emailid], USERPRINCIPALNAME(), [access_type1], "Region"),
   CALCULATETABLE( SELECTCOLUMNS(analytics_auth1, "level1", [level1]),  FILTER(analytics_auth1, [emailid] = USERPRINCIPALNAME())), [region] )

 

 

 

Please let me know your suggestions why it is not working with IF condition.

 

Thank you in advance.

 

Arvind

1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

 

Please provide some dummy data, and show us the difference of the result return by formula with IF condition and without IF condition. If using IF condition, is there any error?

 

Regards,

Yuliana Gu

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

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.