Forum Discussion
Dax Measure based on if Dynamic RLS is applied
Hi,
I have set up several security roles and one of them is a dynamic role by using [user email]= userprincipalname()
Is there a way we can add condition on a dax measure, if that dynamic role is applied (someone from the dynamic role list accessed report), show [measure 1], otherwise show [measure 2] ?
Thanks a lot!
Best Regards
4 Replies
- Lexi_LiuFrequent Visitor
Thanks for your response. So basically I have two DAX measure in my reports and their calculation is different. I want to have a new DAX with condition, let's say if someone from the Dynamic User List accessed the report, they will see the first type of calculation, but other user (or by default) will see the second type of calculation.
Something like: [Condition]=calculate(if(User is from Dynamic Role), [Measure1], [Measure2])
I learnt from another post that looks similar to my question and it looks we cannot make it because "RLS is applied at the dataset level, the measure is created inside the dataset."☹️
- AnonymousNot applicable
Hi Lexi_Liu ,
As far as I know, you can configure multiple roles for different conditions. Then add the users into different roles after you publish to Power BI Service.
For example, in my sample I create two roles for different condtions in Power BI Desktop.
Publish to Power BI Service > Dataset>Security>Add Roles
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Lexi_LiuFrequent Visitor
Hi Rico, this may not what I'm looking for but thanks a lot for your help!