Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hello I have a bit of an issue where I have a bunch of nested tables with the same number of rows and only one column, I am trying to make the 1st column into the header and have the nested table as the rows.
This code worked when I only had two data points (two nested rows) but when I have more or less it breaks at the Table.Transpose step:
let
Source = Table.FromColumns({Lines.FromBinary(Web.Contents("Online Calendar"), null, null, 1252)}),
#"Split Column by Delimiter" = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByEachDelimiter({":"}, QuoteStyle.Csv, false), {"Column1.1", "Column1.2"}),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column1.1", type text}, {"Column1.2", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Column1.1"}, {{"Count", each _, type table [Column1.1=nullable text, Column1.2=nullable text]}}),
#"Removed Top Rows" = Table.Skip(#"Grouped Rows",6),
#"Removed Bottom Rows" = Table.RemoveLastN(#"Removed Top Rows",3),
#"Added Custom" = Table.AddColumn(#"Removed Bottom Rows", "Custom", each Table.Transpose([Count], {"Column1.1", "Column1.2"})),
#"Added Custom2" = Table.AddColumn(#"Added Custom", "Custom.1", each Table.CombineColumns([Custom], {"Column1.1", "Column1.2"}, Combiner.CombineTextByDelimiter(":", QuoteStyle.None), "FullName")),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom2",{"Custom.1"}),
#"Expanded Custom.1" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom.1", {"FullName"}, {"Custom.1.FullName"}),
#"Removed Alternate Rows" = Table.AlternateRows(#"Expanded Custom.1",0,1,1), #"Split Column by Delimiter1" = Table.SplitColumn(#"Removed Alternate Rows", "Custom.1.FullName", Splitter.SplitTextByEachDelimiter({":"}, QuoteStyle.Csv, false), {"Custom.1.FullName.1", "Custom.1.FullName.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter1",{{"Custom.1.FullName.1", type text}, {"Custom.1.FullName.2", type text}}),
#"Transposed Table" = Table.Transpose(#"Changed Type1"),
#"Renamed Columns" = Table.RenameColumns(#"Transposed Table",{{"Column1", "Date"}, {"Column2", "Description"}}),
#"Changed Type2" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type date}}) in #"Changed Type2"
try something like this
let
header=table[Column1.1],
valuescols=List.Transform(table[Count], each _[Column1.2]),
tfc=Table.FromColumns(valuecols,header)
in
tfc
"table" is your last working step, that in the picture
I am trying to do this in Power Query but it doesn't like me using "header =" because it doesn't recognize it as a function. How would I type this into Power Query?
| User | Count |
|---|---|
| 12 | |
| 8 | |
| 5 | |
| 5 | |
| 5 |