Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I am trying to write a dax for a single role and I want to use fields to create multiple situations using two tables within the same role and same table. I cannot create multiple roles for this condition. Sample data:
TABLE A
IdA Colx Coly |
1 D US |
1 I US |
2 D CA |
2 I IN |
TABLE B
IdB role Inter Dom
1 true true false
2 true false true
3 true false false
4 true
Now I want to write one dax such that:
( ([RoleS] = TRUE() && Dom = False() || Dom = BLANK()) && ([Inter] = False() || [Inter] = BLANK()))
AND Colx = "D" )
OR
(
[RoleS] = TRUE()
&&
(
[Dom] = TRUE() || [Inter] = TRUE()
) && NOT(ISBLANK([Dom])) AND
Colx = "D" || (Colx = "I" && Coly = "US"
)
Table A have many to one relationship with Table B. I need to write one common DAX for both of these situations, or if a third situation is in addition where I want any value for colx or any value for colY.
Please help! thanks
Sounds like you need to apply your RLS rules to Table A and you need to pull in all three columns from Table B via Power Query lookups. Are you really sure you want to do that? Normal RLS is applied to dimension tables (Table B) and then propagated down via the data model.
This part
([RoleS] = TRUE() && Dom = False() || Dom = BLANK())
most likely does not do what you expect. I think you wanted to write
[RoleS] = TRUE() && (Dom = False() || Dom = BLANK())
See pbix attached