Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Quiny_Harl
Advocate III
Advocate III

How to restrict access to only certain measures?

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!


1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

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] ) )

View solution in original post

4 REPLIES 4
jdbuchanan71
Super User
Super User

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/

 

jdbuchanan71
Super User
Super User

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] ) )
jdbuchanan71
Super User
Super User

@Quiny_Harl 

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.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors