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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Nathan_M_
Regular Visitor

Custom Index column in DAX Power BI to anonymize data

Hey all,

 

I'm trying to anonymize my data in Power BI desktop with DAX as I can't access Power Query. Is it possible to create a custom index column that instead of just numbering each row create something like this 'Customer 1, Customer 2' or 'Supplier 1, Supplier 2' etc.

 

Any help would be appreciated 

Thanks

Nathan

1 ACCEPTED SOLUTION

then the sequence will be different. not sure if that is fine for you.

 

Column = "Customer" & CALCULATE(DISTINCTCOUNT('Table'[Customer]),FILTER('Table','Table'[Customer]<=EARLIER('Table'[Customer])))
 
11.PNG
 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

7 REPLIES 7
ryan_mayu
Super User
Super User

could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




CustomerSales(NEW) anonymize column
Ryan500Customer 1
Samantha2000Customer 2
Pete150Customer 3

 

@Nathan_M_ 

maybe you can try this in PQ

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCqpMzFPSUTI1MACSzqXFJfm5qUUKhkqxOtFKwYm5iXklGYlAGSMDVAVGYAUBqSWpQFFDUxQ5Y6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Customer = _t, Sales = _t, #"(NEW) anonymize column" = _t]),
#"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each "Customer" & Text.From([Index])),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"})
in
#"Removed Columns"

 

11.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you for the help so far, but i need to do this in Power BI Desktop as I can't access PQ

then the sequence will be different. not sure if that is fine for you.

 

Column = "Customer" & CALCULATE(DISTINCTCOUNT('Table'[Customer]),FILTER('Table','Table'[Customer]<=EARLIER('Table'[Customer])))
 
11.PNG
 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you that works great!!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.