Forum Discussion
RLS with multiple combination
Hi. Yes. You can import the table in order to relate that with the dimension that contains the conditions like something related with country/location. The table might be * to *. I know they say you shouldn't ever do that, but the real answer is "be aware of what you are doing before using that".
You can use a single direction from the rls to the model in order to create a dynamic filter. The more columns you want to use for conditions the more complex the rules of dax will be. Usually when it's one, with a simple usernameprincipal() it's enough, but if you want to compare also a smaller granularity, you might need to build a complex dax inside the dimension besides the rule for the RLS table.
You can check this simple example to get the idea step by step.
https://blog.ladataweb.com.ar/post/652895563673649152/powerbi-seguridad-de-filas-rls-con-regla
I hope that helps,
Hi ibarrau,
Thank you for responding and clarifying the concept. Just a request, to check the application of the particular RLS; if I create a pbix file and attach it here, can you attach a working version of rls dashboard here?
Thanks in advance
- ibarrau2 years agoSuper User
Hi. You can check the pbix of the example at my github repo: https://github.com/ibarrau/PowerBi-code/blob/master/PowerBi%20Reports/BlogDemos.pbix
Remember you can test how the role looks like with specific email and rule selected at PBI Desktop.
Regards,
- Anonymous2 years agoNot applicable
Hi. Thanks a lot. But how does Power BI read "All" for a column value and show all the related values for a particular hierarchy and not all the values that the column holds?
Do we need to create a separate column that's the combination of the columns present for a specific row?
- ibarrau2 years agoSuper User
Well that's the dax challenge I have mentioned before. You will need to think about a logic asking for the columns and don't filter when "All" or something like that.
Yes, you also have the option of separating a row for each combination without the all. That would make DAX easier because you could build a column for each table (RLS table and dimension) that matches exactly for the rows to filter.
I hope that make sense