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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
vkavinbharathi
New Member

Masking the column values based on the user Region

I have a customer dataset and the report would be accessed by both region specific and global audiences. now, for the data from Honk kong region, if a user from US region access the report they should see only the masked data for all the categorical column and only see the numerical columns. 

How this can be done. 

I have a column called Region, ticketnumber, etc..,

I also have another dataset that contains user email and region. 


how this can be implemented?

4 REPLIES 4
v-ssriganesh
Community Support
Community Support

Hello @vkavinbharathi,

Hope everything’s going great with you. Just checking in has the issue been resolved or are you still running into problems? Sharing an update can really help others facing the same thing.

Thank you.

v-ssriganesh
Community Support
Community Support

Hello @vkavinbharathi,

We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.

Thank you.

v-ssriganesh
Community Support
Community Support

Hello @vkavinbharathi,
Thank you for reaching out to the Microsoft Fabric Community Forum.

I’ve reproduced your use case in Power BI Desktop and was able to achieve the expected result based on your requirement:

  • When a user accesses data from their own region, they see all the data (including sensitive categorical fields).
  • When a user accesses data from a different region, they only see the numeric fields, and all categorical/text fields are masked dynamically.

This is implemented using:

  • USERPRINCIPALNAME() to detect the logged-in user's identity.
  • A User-Region mapping table combined with RLS (Row-Level Security).
  • DAX measures (instead of calculated columns) to apply conditional masking at runtime.

Sensitive values like TicketNumber, CustomerName are replaced with "*****" or "Confidential" when region mismatch is detected. For your reference, I’m attaching the .pbix file that demonstrates this scenario:

You can test the behavior using the "View As" feature in Power BI Desktop with test users like:

  • ususer@demo.com → Sees full US data, masked Hong Kong data
    vssriganesh_0-1753762916358.png

     

  • hkuser@demo.com → Sees full Hong Kong data, masked US data
    vssriganesh_1-1753762916359.png

If you have any further questions, please don't hesitate to contact us through the community. We are happy to assist you.

Best Regards,
Ganesh singamshetty.

MasonMA
Solution Sage
Solution Sage

Hello @vkavinbharathi 

 

You may use the strategies from this post shared by other users. You will see detailed steps. The logic looks correct to me and with RLS plus LOOKUPVALUE you would be able to implement it. 

Fyi, I haven't had a chance to test/validate it myself but please let us know if this works:) 

 

Dynamic Data Masking - Microsoft Fabric Community

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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