Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet 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
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 65 | |
| 64 | |
| 49 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 119 | |
| 117 | |
| 38 | |
| 36 | |
| 29 |