Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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.
User | Count |
---|---|
84 | |
78 | |
70 | |
47 | |
41 |
User | Count |
---|---|
108 | |
52 | |
50 | |
40 | |
40 |