Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi!
I have table with names:
John Doe
Mary James
Johny Depp
Pater Griffin
John Doe
they can be repeated
I need anonymize names and bring them to this form:
John Doe > user-1
Mary James > user-2
Johny Depp > user-3
Pater Griffin > user-4
John Doe > user-1
This is possible?
Thank you advanced
Solved! Go to Solution.
Hi @aignn
Yes, Group By Name keeping all rows. Then add an index column starting from 1 and add a Custom Column joining the real name and the index number. Expand the rows again
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8srPyFNwyU9VitWJVvJNLKpU8ErMTS0Gc0FyeZUKLqkFBWB+QGpJapGCe1FmWlpmHlwFRHcsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t]),
#"Grouped Rows" = Table.Group(Source, {"Name"}, {{"Count", each _, type table [Name=nullable text]}}),
#"Added Index" = Table.AddIndexColumn(#"Grouped Rows", "Index", 1, 1, Int64.Type),
#"Added Custom1" = Table.AddColumn(#"Added Index", "Custom.1", each "user-" & Text.From([Index])),
#"Expanded Count" = Table.ExpandTableColumn(#"Added Custom1", "Count", {"Name"}, {"Name.1"})
in
#"Expanded Count"
Regards
Phil
Proud to be a Super User!
@aignn , You can create a index column and add append that with user
index =https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
new column = "User " & [index]
Hi @aignn
Yes, Group By Name keeping all rows. Then add an index column starting from 1 and add a Custom Column joining the real name and the index number. Expand the rows again
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8srPyFNwyU9VitWJVvJNLKpU8ErMTS0Gc0FyeZUKLqkFBWB+QGpJapGCe1FmWlpmHlwFRHcsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t]),
#"Grouped Rows" = Table.Group(Source, {"Name"}, {{"Count", each _, type table [Name=nullable text]}}),
#"Added Index" = Table.AddIndexColumn(#"Grouped Rows", "Index", 1, 1, Int64.Type),
#"Added Custom1" = Table.AddColumn(#"Added Index", "Custom.1", each "user-" & Text.From([Index])),
#"Expanded Count" = Table.ExpandTableColumn(#"Added Custom1", "Count", {"Name"}, {"Name.1"})
in
#"Expanded Count"
Regards
Phil
Proud to be a Super User!
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 |
|---|---|
| 103 | |
| 80 | |
| 63 | |
| 50 | |
| 45 |