Forum Discussion
Hiding an entire column for specified users by RLS
- 5 years ago
Analyst001
You can achieve this using Object Level Security (OLS). Please refer to the following article on how to apply.
https://www.fourmoo.com/2021/03/02/configure-ols-in-power-bi-using-tabular-editor-to-limit-access-to-non-financial-measures/ - 5 years ago
Object-Level-Security is now natively avaiable in Power BI
https://powerbi.microsoft.com/en-us/blog/object-level-security-ols-is-now-generally-available-in-power-bi-premium-and-pro/
I haven't actually had a reason to use it yet, but it seems like exactly what you need. - 5 years ago
Analyst001
Please download the Tabular Editor 2 from the following link: https://github.com/otykier/TabularEditor/releases/tag/2.16.0
The best work around I devised was to unpivot the column that you're trying to hide with another column that you don't care about.
This will effectively gives you two copies of each row in your data set. Then, you can create a new dynamic column, which contains (i) for the "urestricted user group", the value in the column and (ii) for the "restricted user group", an empty string or a word like "[Redacted]". This dynamic column would be created using an if statement.
Then, all you have to do is assign two different row level security rules to your two user populations and select, based on the value of your dynamic column. This will change of the two parts of your data said they will see. Haven’t thought too much about it, but it is likely that this workaround could be extended or enhanced with little work.
It probably has been said but userprincipalname() doesn't work for calculated columns.
Again, you just have to make sure you pick your second parameter that you will use to pivot to be something you don't care about hiding.