Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
JajatiDev
Helper II
Helper II

Splitting a table of tables

Hi,

I created a table of tables with the following query.

 

let
    Source = Excel.CurrentWorkbook(){[Name="Raw_Data"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Scheme or Stock name", type text}, {"Investment date", type date}, {"Investment price", type number}, {"Units", type number}, {"Investment amount", type number}, {"Current price", type number}, {"Current market value", type number}, {"Gain", type number}}),
    #"Sorted Rows" = Table.Sort(#"Changed Type",{{"Scheme or Stock name", Order.Ascending}, {"Investment date", Order.Ascending}}),
    Add_Index = Table.AddIndexColumn(#"Sorted Rows", "Index", 1, 1, Int64.Type),
    Add_Previous = Table.AddColumn(Add_Index, "PreviousContent", each try if [Index] = 1 then null else Add_Index{[Index]-2} [Scheme or Stock name] otherwise null),
    Add_ChangeFlag = Table.AddColumn(Add_Previous, "ChangeFlag", each if [Scheme or Stock name] <> [PreviousContent] then 1 else 0),
    Add_Group = Table.AddColumn(Add_ChangeFlag, "Group", each List.Sum(List.FirstN(Add_ChangeFlag[ChangeFlag], [Index]))),
    GroupedTables = Table.Group(Add_Group, "Group", {{"AllData", each Table.RemoveColumns(_, {"PreviousContent", "ChangeFlag", "Group", "Index"}), type table [Content=nullable text]}}),
    #"Changed Type1" = Table.TransformColumnTypes(GroupedTables,{{"Group", Int64.Type}})
in
    #"Changed Type1"

 

JajatiDev_0-1719681918232.png

Now I'm trying to expand these tables into separate tables dynamically becasue the number of tables in the table of tables is subject to change.

 

Please guide me on the next steps.

1 REPLY 1
lbendlin
Super User
Super User

Not possible. Power Query does not support dynamic creation of data sources.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.