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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Fraukje
Advocate I
Advocate I

How to anonymize/mask part of string?

Say I am creating a pie chart for customer called 'Air Holland', for this customer I would like to show the overlap with other customers in a pie chart, including customers called 'Air Hungary', 'Air Ireland' and 'Air Iceland'. Due to privacy regulations of my customers I can only show partial names, e.g. the first three or four letters of their name. 'Air Holland' thus changes to 'Air xxxxxxx'

 

To implement this now in my pie chart, I have created a new Column CustomerNameMasked that takes the customer name, and replaces all characters but the first four with an 'x'. Ideally I would like to use CustomerName as the Legend in my pie chart, and then the CustomerNameMasked as the label, such that the pie chart is created using CustomerName, but will show the masked names.

 

However, as far as I know such a label is not possible, so now I have used CustomerNameMasked as my Legend column. But since these name are not unique (e.g. 'Air Hungary' and 'Air Holland' are both 'Air xxxxxxx' in the CustomerNameMasked column), different customers are taken together.

 

Any ideas how to create unique masked customer names? Or another work-around to ensure that my pie chart correctly shows the data per customer, but the legend shows masked names?

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

I would create a query that ingested the customer names and add an Index column to it. Then, when you create the anonymized names, just append the Index value and you will guarantee uniqueness.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

I would create a query that ingested the customer names and add an Index column to it. Then, when you create the anonymized names, just append the Index value and you will guarantee uniqueness.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler,

 

Thanks so much for taking the time to understand my problem and reply. Great idea, I think your idea solves my problem!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors