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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Koritala
Helper I
Helper I

Data Masking In Power BI Table visual

Hi All,

 

I need urgent help to mask the PII data in my Table visual for the personal data-related columns in my power bi report.

 

I have 2 types of users. 

1. PII Users

2. Non-PII Users

 

if the user belongs to PII User type, he should be able see the PII columns data. if non-PII user, personal information columns data should be maskes as XXXXXXX.

I have a user table in my redshift database and having 2 columns. 1. user email id 2. PII User(Y/N).

My question is I can't join my user information table with my report query because there is no unique user column in my report query. 

May I know in this scenario, how to mask my report data?

Would approciate if you can share the required measures DAX code.

Thanks,

Srini

 

 

 

1 ACCEPTED SOLUTION
v-venuppu
Community Support
Community Support

Hi @Koritala ,

Thank you for reaching out to Microsoft Fabric Community.

Thank you @Ritaf1983 @Thejeswar for the prompt response.

I have created PBIX file using sample data for Dynamic masking.Please go through the attached PBIX for your reference, even I have tested by replacing USERPRINCIPALNAME() with the email id existing in my UserAccess table.It worked for me.

It shows real data for users with "Y" in IsPIIUser.

It shows asterisks for users with "N" in IsPIIUser.

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

Thank you.

View solution in original post

5 REPLIES 5
v-venuppu
Community Support
Community Support

Hi @Koritala ,

Thank you for reaching out to Microsoft Fabric Community.

Thank you @Ritaf1983 @Thejeswar for the prompt response.

I have created PBIX file using sample data for Dynamic masking.Please go through the attached PBIX for your reference, even I have tested by replacing USERPRINCIPALNAME() with the email id existing in my UserAccess table.It worked for me.

It shows real data for users with "Y" in IsPIIUser.

It shows asterisks for users with "N" in IsPIIUser.

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

Thank you.

Hi Venu,

Appreciate your solution. it is working as expected. Thanks for your support.

Ritaf1983
Super User
Super User

Hi @Koritala 

In Power BI, there is no native support for masking column values like "XXXXXX" based on user type. What you can do instead are the following two approaches:

  1. Row-Level Security (RLS) – You can restrict entire rows based on user access. However, this won't allow you to show/hide or mask specific column values based on user identity. Column-level security is not natively supported.
    More information is by the link:
    https://www.youtube.com/watch?v=jphj40tBPD8

  2. Separate Report Versions – You can create two versions of the report: one for PII users and another for non-PII users (where sensitive columns are removed or replaced with placeholders). Then, use audience targeting in the Power BI app to share each version with the appropriate group.
    https://www.youtube.com/watch?v=nchNa44o2D4

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Thejeswar
Super User
Super User

Hi @Koritala ,

You can use the REPT() DAX function to perform Data Masking of a certain column like shown below

 

For example,  I am masking the food supply level column. You can use substring to control the number of characters that you want to mask 

MaskedData = REPT("*", LEN([Food_Supply_Level]))

Thejeswar_0-1749616749270.png

 

Using Substring:

Thejeswar_1-1749616910696.png

 

 

If this helps, Accept this as a Solution and Appreciate with a Kudo!

 

Regards,

Hi, it should be dynamic masking not static 

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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