Forum Discussion
Dan_TWE
May 14, 2026Copper Contributor
A little help on text grouping delimited by nulls in a data set in power query
A have a column in power query: null line of text line of text line of text null The number of rows with lines of text can vary, but each "text block" is delimited by column entries at the t...
NikolinoDE
May 17, 2026Platinum Contributor
Alternatively, a simplified formula…
let
Source = Excel.CurrentWorkbook(){[Name="Tabelle2"]}[Content],
#"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1, Int64.Type),
#"Added GroupID" = Table.AddColumn(#"Added Index", "GroupID", each
List.Count(List.Select(List.FirstN(Source[Column1], [Index] + 1), each _ = null))),
#"Filtered Nulls" = Table.SelectRows(#"Added GroupID", each [Column1] <> null),
#"Grouped Rows" = Table.Group(
#"Filtered Nulls",
{"GroupID"},
{{"CombinedText", each Text.Combine([Column1], "#(lf)"), type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Grouped Rows",{"GroupID"})
in
#"Removed Columns"
Riny_van_Eekelen
May 17, 2026Platinum Contributor
Simplified?