Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
105 | |
79 | |
69 | |
62 |
User | Count |
---|---|
142 | |
105 | |
103 | |
84 | |
70 |