The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi, folks,
Is there a way to restrict some users' access to one or more measure/s only?
Object level security (OLS) does not work in my case because I have visuals, for example a table visual, which contains other data in addition to the measures that should be hidden. So if I use OLS, the whole table visual will be hidden from users, which includes measures and columns that all report users must be able to see.
The workaround with the page level security is a back-up option which I would prefer to avoid because I will have to re-work my whole report which contains many pages and then it will contain even more pages.
Thanks for your time!
Solved! Go to Solution.
OK, you could modify the measure to read the user with userprincipalname() then return BLANK() if they matched a criteria. It would look something like this.
Bonus Amount =
VAR _UPN =
USERPRINCIPALNAME ()
VAR _UserType =
LOOKUPVALUE ( 'Users'[Role], 'Users'[Email], _UPN )
RETURN
IF ( _UserType = "Sales", BLANK (), SUM ( 'Payroll'[Bonuses] ) )
This also sounds like a good option for applying in a calculation group. That way, if you found new measures you wanted to restrict, you could just add them to the calculation group.
https://www.sqlbi.com/calculation-groups/
OK, you could modify the measure to read the user with userprincipalname() then return BLANK() if they matched a criteria. It would look something like this.
Bonus Amount =
VAR _UPN =
USERPRINCIPALNAME ()
VAR _UserType =
LOOKUPVALUE ( 'Users'[Role], 'Users'[Email], _UPN )
RETURN
IF ( _UserType = "Sales", BLANK (), SUM ( 'Payroll'[Bonuses] ) )
Would it work if you created a dummy table to hold the measures you want to restrict. Move the measure there (measures can belong to any table) then apply OLS to that table?
Thanks for your reply. The measures that need to be restricted are part of visuals that contain other data that needs to be seen. So when I apply the OLS, those visuals will appear broken to the users with restricted access while they should be able to see them. In the best case scenario, the measures should return a blank value when a user with restricted access opens the page.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
81 | |
72 | |
49 | |
41 |
User | Count |
---|---|
139 | |
113 | |
74 | |
64 | |
63 |