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 every body,
I have a dat and I work with Power BI Desktop, and I want befor to start my analysis to anonymize(mask) the first name column and the last name column(and replace by a ID code).
Any ideas how to create unique masked customer names with Power BI?
Thank you.
Best regards,
Solved! Go to Solution.
One way of preventing anonymised names from being merged in visualisations is to make sure they are not the same.
Add a calculated column:
Anonymised = "Airline " & RANKX('MyTable','MyTable'[CustomerName],,ASC,Dense)Result:
Airline 1 Airline 2 Airline 3 ...
If you prefer x's:
Add a Anonymised_Name table,
Name Anonymised Name "Air Holland" "Air xxxxxxx" "Air Hungary" "Air xxxxxxx " "Air Iceland" "Air xxxxxxx "
Use "fake space" (alt+0160 on the numpad) to prevent PowerBI from swallowing it up. Add a relationship and use this column in visualisations.
I prefer previous option as it makes it easier to distinguish and keep track of individual customers.
If you don't care whether number of "x"s matches real name:
Anonymised_Name_2 = "Air XXXXXXX" & REPT(" ",
RANKX('MyTable','MyTable'[CustomerName],,ASC,Dense))(again fake space alt+0160)
Depending on what you do with your report, there is a significant risk of real customer names "leaking", so ideally you would want to anonymize your data before importing it.
One way of preventing anonymised names from being merged in visualisations is to make sure they are not the same.
Add a calculated column:
Anonymised = "Airline " & RANKX('MyTable','MyTable'[CustomerName],,ASC,Dense)Result:
Airline 1 Airline 2 Airline 3 ...
If you prefer x's:
Add a Anonymised_Name table,
Name Anonymised Name "Air Holland" "Air xxxxxxx" "Air Hungary" "Air xxxxxxx " "Air Iceland" "Air xxxxxxx "
Use "fake space" (alt+0160 on the numpad) to prevent PowerBI from swallowing it up. Add a relationship and use this column in visualisations.
I prefer previous option as it makes it easier to distinguish and keep track of individual customers.
If you don't care whether number of "x"s matches real name:
Anonymised_Name_2 = "Air XXXXXXX" & REPT(" ",
RANKX('MyTable','MyTable'[CustomerName],,ASC,Dense))(again fake space alt+0160)
Depending on what you do with your report, there is a significant risk of real customer names "leaking", so ideally you would want to anonymize your data before importing it.
Thank you Lewis.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 71 | |
| 50 | |
| 47 | |
| 44 |