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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi guys
I have a file like this
I want to tranpose it into this
I did it successfully using Tranpose UI, but I am finding another way, just code manually to do it.
Do you guys have any ideas to do it just with M code?
File in the link
Thanks
Hi @Mai_Tran ,
Thank you @AlienSx for the inputs.
We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.
Best Regards,
Chaithra E.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
headers = {"Region", "Manager", "Year", "Quarter", "Month", "Revenue"},
rows = List.Buffer(Table.ToList(Source, (x) => x)),
periods = List.Buffer(List.Zip(List.Transform(List.Range(rows, 1, 3), (r) => List.Skip(r, 2)))),
trx = List.TransformMany(
List.Skip(rows, 4),
(x) => List.Zip({periods, List.Skip(x, 2)}),
(x, y) => List.FirstN(x, 2) & y{0} & {y{1}}
),
result = Table.FillDown(Table.FromList(trx, (x) => x, headers), headers)
in
result
Vote for your favorite vizzies from the Power BI World Championship submissions!
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 |
|---|---|
| 15 | |
| 11 | |
| 11 | |
| 8 | |
| 6 |