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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
leopinheiro_chi
New Member

How to mask sensitive columns for a set of users?

Hi all,

 

My dataset contains some sensitive columns like email, ssn, etc, and I would like to replace their values with "[redacted]" depending on what user is viewing the dashboard.

 

To achieve that I have done these steps:

 

1. Create a separate table containing all users with the privilege to see that information. Let's call it "privileged_users"

2. In the original table (user_info) create a measure similar to this: 

 

 

email_masked = IF(CONTAINS(privileged_users,privileged_users[user_name], USERNAME()), user_info[email], "[redacted]")

 

 

3. Use the new column email_masked in my visualization, instead of the original column

 

Functionally this approach seems to work. However, it becomes very very slow as the table gets bigger. In fact, sometimes the visualization errors saying that it is running out of memory.

 

Is there any more efficient way to achieve this? Thanks!! 

2 ACCEPTED SOLUTIONS
aj1973
Community Champion
Community Champion

Hi @leopinheiro_chi 

You need to implement OLS

Object-level security (OLS) with Power BI - Power BI | Microsoft Learn

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

Greg_Deckler
Community Champion
Community Champion

@leopinheiro_chi OLS has a tendency to break visuals for users that can't see the columns. Here is an alternative approach that doesn't have that particular issue:

Column Level Security - Microsoft Fabric Community

 

The advantage of this approach is that there is actual security involved (in your approach if the user modifies the report or otherwise has access to the dataset, they can circumvent the obfuscation). Also, should perform fast regardless of semantic model size.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@leopinheiro_chi OLS has a tendency to break visuals for users that can't see the columns. Here is an alternative approach that doesn't have that particular issue:

Column Level Security - Microsoft Fabric Community

 

The advantage of this approach is that there is actual security involved (in your approach if the user modifies the report or otherwise has access to the dataset, they can circumvent the obfuscation). Also, should perform fast regardless of semantic model size.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
aj1973
Community Champion
Community Champion

Hi @leopinheiro_chi 

You need to implement OLS

Object-level security (OLS) with Power BI - Power BI | Microsoft Learn

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors