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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Fali324
Helper II
Helper II

Anonymize names and assign Letters

Hi, 

 

I've been stuck on the following problem and hoping someone can help me on this.

 

I have a data table which has the following columns:

Project Name - String

Anonymise - Boolean

Location - String

Area - Number

 

using a slicer, the user is able to click on the project name and then select yes or no if that name should be anonymised. 

 

I would like to anonymise the project name and then sort the selection according to area to assign a chronological letter.

 

Eg.

This is the data table

Project NameArea
Project A10
Project B23
Project C43
Project D5
Project E1
Project F3
Project G4

 

I have selected Project A, E , F, G for a bar chart and have selected the names are anonomised, therefore the output I'm looking for is

Fali324_0-1684240512937.png

 

Is this possible?

Any advice would be much appricated. 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @Fali324 ,

 

Please try:

First create a new table:

Anonymise Name = ADDCOLUMNS(GENERATESERIES(0,DISTINCTCOUNT('Table'[Project Name]),1),"Name",UNICHAR(UNICODE("A")+[Value]))

Output:

vjianbolimsft_0-1684394870379.png

Then create a field parameter:

vjianbolimsft_1-1684394949873.png

Add a new column to the parameter table:

Boolean = IF([Parameter Order]=0,"False","True")

Output:

vjianbolimsft_2-1684395010126.png

Create a slicer:

vjianbolimsft_3-1684395040569.png

Apply the measure to the column chart:

Measure = 
var _a = ADDCOLUMNS('Table',"Index",RANKX('Table',[Area],CALCULATE(SUM('Table'[Area])),ASC))
var _b = CALCULATE(SUM('Table'[Area]),FILTER(_a,[Index]=SELECTEDVALUE('Anonymise Name'[Value])+1))
var _c = SUM('Table'[Area])
return 
IF(SELECTEDVALUE(Parameter[Boolean])="True"&&ISFILTERED(Parameter[Boolean]),_b,_c)

vjianbolimsft_4-1684395087453.png

Final output:

vjianbolimsft_5-1684395102474.png

Best Regards,

Jianbo Li

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

View solution in original post

2 REPLIES 2
esingh
Helper I
Helper I

Hi 

 

How to make this solution work if we have multiple entries in the dataset for different institution.

 

Thanks

Ekam

v-jianboli-msft
Community Support
Community Support

Hi @Fali324 ,

 

Please try:

First create a new table:

Anonymise Name = ADDCOLUMNS(GENERATESERIES(0,DISTINCTCOUNT('Table'[Project Name]),1),"Name",UNICHAR(UNICODE("A")+[Value]))

Output:

vjianbolimsft_0-1684394870379.png

Then create a field parameter:

vjianbolimsft_1-1684394949873.png

Add a new column to the parameter table:

Boolean = IF([Parameter Order]=0,"False","True")

Output:

vjianbolimsft_2-1684395010126.png

Create a slicer:

vjianbolimsft_3-1684395040569.png

Apply the measure to the column chart:

Measure = 
var _a = ADDCOLUMNS('Table',"Index",RANKX('Table',[Area],CALCULATE(SUM('Table'[Area])),ASC))
var _b = CALCULATE(SUM('Table'[Area]),FILTER(_a,[Index]=SELECTEDVALUE('Anonymise Name'[Value])+1))
var _c = SUM('Table'[Area])
return 
IF(SELECTEDVALUE(Parameter[Boolean])="True"&&ISFILTERED(Parameter[Boolean]),_b,_c)

vjianbolimsft_4-1684395087453.png

Final output:

vjianbolimsft_5-1684395102474.png

Best Regards,

Jianbo Li

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors