Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.