Forum Discussion
Anonymous
6 years agoNot applicable
Power BI Row Level Security Help
I need some help with some Row Level Security DAX formulas in Power BI. I have a list of Customers below and a filter selection. Some users can see all the data, and some users can only see part...
- Anonymous6 years ago
What I ended up doing was using a SWITCH function. I created a new column for each role, then a Measure to Switch between the columns depending on the role.
Measure = SWITCH(SELECTEDVALUE('Table'[Switch]),"A",MAX(Security[Root_Cause_A]),"B",MAX(Security[Root_Cause_B]),MAX(Security[Root Cause]))Here is what the Switch table looks like. I then assign role level secuirty to select a single row in the Switch table.Here is what the table looks like viewing as Customer B. Notice how the Measure field is blank for all Customers except Customer B.
Anonymous
6 years agoNot applicable
Hi Anonymous ,
As you know, it's "Row" level security.
You want to show blank in column value for different customers.
I think you can try to make it in DAX, something like:
measure = if(username() = "A", if(customer_name = username(),customer_name,blank()))
Aiolos Zhao
Anonymous
6 years agoNot applicable
What I ended up doing was using a SWITCH function. I created a new column for each role, then a Measure to Switch between the columns depending on the role.
Measure = SWITCH(SELECTEDVALUE('Table'[Switch]),"A",MAX(Security[Root_Cause_A]),"B",MAX(Security[Root_Cause_B]),MAX(Security[Root Cause]))
Here is what the Switch table looks like. I then assign role level secuirty to select a single row in the Switch table.
Here is what the table looks like viewing as Customer B. Notice how the Measure field is blank for all Customers except Customer B.