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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi, I want to clean this table in such a way that I can make reports.
Here you can see dates in columns 1 and 7 with the same titles in between.
Is there any way where I can stack these columns in a format of
columns 1 to 6
Columns 7 to 12
Columns 13 to 18
on top of each other?
I believe merge / append queries don't work for this: Happy for suggestions
Solved! Go to Solution.
Hi @koiralasmn, for future requests: provide sample date as table so we can copy/paste. Thanks.
Before:
After:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUtJRMjFVyM3MU0itALKDUssU0vMTc4qBbDMDsHhJUWJmXmZeOlDEyEDBJ780MxWsMDFFwdAAyBp4E2J1opUs9A31jQyMjIDCbo4+wa5E0JYILSFBofhUQqUNDQjqgAqDKYizjEh3lhFxlsC4QGeRaAnEZcaku8yYZJcR0oGiMzYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t, Column7 = _t, Column8 = _t, Column9 = _t, Column10 = _t, Column11 = _t, Column12 = _t, Column13 = _t, Column14 = _t, Column15 = _t, Column16 = _t, Column17 = _t, Column18 = _t]),
SplitBy = [ a = List.PositionOf(Record.ToList(Source{0}), "", Occurrence.All),
b = a{1} - a{0}
][b],
StepBack = Source,
PromotedHeaders = Table.PromoteHeaders(StepBack, [PromoteAllScalars=true]),
SplitAndCombine = Table.Combine(List.Transform(List.Split(Table.ToColumns(PromotedHeaders), SplitBy), Table.FromColumns)),
RenamedColumns = Table.RenameColumns(SplitAndCombine, List.Zip({ Table.ColumnNames(SplitAndCombine), {"Date"} & List.Skip(List.FirstN(Table.ColumnNames(PromotedHeaders), SplitBy)) }))
in
RenamedColumns
Hi @koiralasmn, for future requests: provide sample date as table so we can copy/paste. Thanks.
Before:
After:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUtJRMjFVyM3MU0itALKDUssU0vMTc4qBbDMDsHhJUWJmXmZeOlDEyEDBJ780MxWsMDFFwdAAyBp4E2J1opUs9A31jQyMjIDCbo4+wa5E0JYILSFBofhUQqUNDQjqgAqDKYizjEh3lhFxlsC4QGeRaAnEZcaku8yYZJcR0oGiMzYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t, Column7 = _t, Column8 = _t, Column9 = _t, Column10 = _t, Column11 = _t, Column12 = _t, Column13 = _t, Column14 = _t, Column15 = _t, Column16 = _t, Column17 = _t, Column18 = _t]),
SplitBy = [ a = List.PositionOf(Record.ToList(Source{0}), "", Occurrence.All),
b = a{1} - a{0}
][b],
StepBack = Source,
PromotedHeaders = Table.PromoteHeaders(StepBack, [PromoteAllScalars=true]),
SplitAndCombine = Table.Combine(List.Transform(List.Split(Table.ToColumns(PromotedHeaders), SplitBy), Table.FromColumns)),
RenamedColumns = Table.RenameColumns(SplitAndCombine, List.Zip({ Table.ColumnNames(SplitAndCombine), {"Date"} & List.Skip(List.FirstN(Table.ColumnNames(PromotedHeaders), SplitBy)) }))
in
RenamedColumns
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.