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! Don't miss your chance! Learn more
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
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 68 | |
| 59 | |
| 44 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 104 | |
| 102 | |
| 37 | |
| 26 | |
| 25 |