Forum Discussion
Row level security _ DAX
I made some modifications to your file:
sampleFileSecu.pbix
Hello sturlaws
Thanks for your help. I do have the wanted result when I test it with user "test".
But when I test it with other users which are supposed to have specific access to some sector, they actually get access to all sectors.
- sturlaws6 years agoResident Rockstar
My bad, I thought that what were what you wanted. Then the case is"See your own sector and the total of your region", which is a common scenario.
You have three options:
1. If you are making the reports, and the data model is not meant for self service or exploration, you can create a measure to filter e.g. the table visual in your previous post for the sector a user is supposed to see:
sectorFilterMeasure = COUNTROWS ( CALCULATETABLE ( VALUES ( TD_SECTOR[SECTOR_ID] ); FILTER ( TD_SECTOR; TD_SECTOR[SECTOR_ID] IN VALUES ( TD_SECU_SECTOR[SECTOR_ID] ) ) ) )2. Have two sets of fact tables, one set with granularity of sector, the other set with granularity region.
3. Have two sets of measures, one set which returns the sectors for current user, the other set which returns region for current user.
The code needed for the last two options will resemble the RLS filter expressions.