Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Solved! Go to Solution.
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!
Hi @Koritala ,
As this thread is already solved, please create a new thread in the forum. We are happy to assist.
Thank you.
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!
Hi Venu,
The code which you provided for the data masking in table visual based on user type login is giving some issue.
In my report I have a slicers like employersname and Members slicers along with date range slicer. Members slicer will show the coressponding members for the selected Employersname slicer.
I created measure logic for my required columns as per your code provided. The issue is when I drop the firstname masked cloumn which I created, that is not filtering the visaul data as per the employername and Members slicers. For example for X employer there are 2 Members. But when I place the newly created Firstname masked column, it pulling all the records from the backend.
Can you please suggest how to proceed in this scenario.
Thanks,
Sri.
Hi Venu,
Appreciate your solution. it is working as expected. Thanks for your support.
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:
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
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
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]))
Using Substring:
If this helps, Accept this as a Solution and Appreciate with a Kudo!
Regards,
Hi, it should be dynamic masking not static
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.