Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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.
User | Count |
---|---|
121 | |
76 | |
63 | |
51 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |