Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
I am importing a spreedsheet from a pdf so naturally the data is a little bit messy. Almost every other row has a null value in the first column "Queue" because their are some values in different columns that spill over into the next row. I would like to concatenate the spilled values when Queue is equal to null so the data would be transformed from
| Queue | Value1 | MW |
| 1 | New | 105 |
| null | Generator | null |
to
| Queue | Values1 | MW |
| 1 | New Generator | 105 |
Solved! Go to Solution.
Hi @ExcelMagic ,
I would probably approach it like so:
// Table1
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Queue", Int64.Type}, {"Value1", type text}, {"MW", Int64.Type}}),
CombineColumnNames = List.Skip(Table.ColumnNames(#"Changed Type")),
#"Filled Down" = Table.FillDown(#"Changed Type",{"Queue"}),
#"Grouped Rows" = Table.Group(#"Filled Down", {"Queue"}, {{"All", each #table(CombineColumnNames, {List.Transform(List.Skip(Table.ToColumns(_)), (l)=> Text.Combine(List.Transform(l, (i)=> Text.From(i)), " "))})}}),
#"Expanded All" = Table.ExpandTableColumn(#"Grouped Rows", "All", CombineColumnNames)
in
#"Expanded All"
Please also check the file enclosed.
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
Hi @ExcelMagic ,
I would probably approach it like so:
// Table1
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Queue", Int64.Type}, {"Value1", type text}, {"MW", Int64.Type}}),
CombineColumnNames = List.Skip(Table.ColumnNames(#"Changed Type")),
#"Filled Down" = Table.FillDown(#"Changed Type",{"Queue"}),
#"Grouped Rows" = Table.Group(#"Filled Down", {"Queue"}, {{"All", each #table(CombineColumnNames, {List.Transform(List.Skip(Table.ToColumns(_)), (l)=> Text.Combine(List.Transform(l, (i)=> Text.From(i)), " "))})}}),
#"Expanded All" = Table.ExpandTableColumn(#"Grouped Rows", "All", CombineColumnNames)
in
#"Expanded All"
Please also check the file enclosed.
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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.