Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Solved! Go to Solution.
then the sequence will be different. not sure if that is fine for you.
Proud to be a Super User!
could you pls provide some sample data and expected output?
Proud to be a Super User!
Customer | Sales | (NEW) anonymize column |
Ryan | 500 | Customer 1 |
Samantha | 2000 | Customer 2 |
Pete | 150 | Customer 3 |
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"
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.
Proud to be a Super User!
Thank you that works great!!
you are welcome
Proud to be a Super User!
User | Count |
---|---|
79 | |
74 | |
44 | |
32 | |
28 |
User | Count |
---|---|
100 | |
93 | |
52 | |
50 | |
48 |