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.
Hi,
This is my first post. I'm trying to create a table from the "starting point" to the "Final" below.
Could you guide. I've tried adding a count column and do an unpivot/Pivot. Nothing is working.
If you have any idea that would be great.
Starting point
Sales | Account | Role |
Julien | Account 1 | Inside Sales |
Julien | Account 2 | Inside Sales |
Michael | Account 1 | Territory Sales |
Michael | Account 2 | Territory Sales |
Michael | Account 3 | Territory Sales |
Final
Account | Inside Sales | Territory Sales |
Account 1 | Julien | Michael |
Account 2 | Julien | Michael |
Account 3 | Michael |
Solved! Go to Solution.
Hooray!! I think I finally figured one of these out!! @ImkeF are you proud of me!?!?
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8irNyUzNU9JRckxOzi/NK1EwBLI984ozU1IVghNzUouVYnWwqDLCpso3MzkjMTUHzbCQ1KKizJL8okq8Ko2IVmmMTWUsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Sales = _t, Account = _t, Role = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Sales", type text}, {"Account", type text}, {"Role", type text}}), #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Role]), "Role", "Sales") in #"Pivoted Column"
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |