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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply

Grouping on merge tables

I am nearly there but not too sure on the grouping if it'll work, would appreciate your advice

 

Sub project code table

michellerob2000_0-1670589696453.png

 

Member table

michellerob2000_1-1670589696457.png

 

I have merged these tables and here is what I have

michellerob2000_2-1670589696462.png

 

Group on Sub project

With App Group name and approver names

 

michellerob2000_3-1670589696465.png

 

Thank you in advance

Michelle

7 REPLIES 7

Im trying again to explain what Im trying to achieve below: hopefully it might help (got my fingers crossed)

 

michellerob2000_0-1671032647963.png

 

 

Sorry about that, see below what I'm trying to achieve (the latter)

 

michellerob2000_0-1670602726379.png

 

Anonymous
Not applicable

Just to be sure you want this outcome from your merged table?

JamesRobson_1-1670604757732.png

 

Yes please from the  merge1 table.

 

Your script that you provided failed at the first table1 (I don't have table1 label anywhere - I tried changing it to merge1 but it still fails

And I dont need the Level 1 and 2 - just the approver 1,2,3,4,5,etc

Anonymous
Not applicable

let
Source = Table.NestedJoin(Table1, {"Level 2"}, Table2, {"App Group name"}, "Table2", JoinKind.LeftOuter),
#"Expanded Table2" = Table.ExpandTableColumn(Source, "Table2", {"App Group name", "Approver 1", "Approver 2"}, {"App Group name", "Approver 1", "Approver 2"}),
#"Reordered Columns" = Table.ReorderColumns(#"Expanded Table2",{"Sub Project", "App Group name", "Level 1", "Level 2", "Approver 1", "Approver 2"}),
#"Appended Query" = Table.Combine({#"Reordered Columns", #"Reordered Columns"}),
#"Sorted Rows" = Table.Sort(#"Appended Query",{{"Sub Project", Order.Ascending}}),
#"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Index", 1, 1, Int64.Type),
SubProject = Table.AddColumn(#"Added Index", "Sub Project Blank", each if Number.IsOdd([Index]) then [Sub Project] else ""),
#"App Group Name" = Table.AddColumn(#"SubProject", "App Group name Blank", each if Number.IsOdd([Index]) then "" else [App Group name]),
#"Level 1" = Table.AddColumn(#"App Group Name", "Level 1 blank", each if Number.IsOdd([Index]) then "" else [Level 1]),
#"Level 2" = Table.AddColumn(#"Level 1", "Level 2 blank", each if Number.IsOdd([Index]) then "" else [Level 2]),
#"Approver 1" = Table.AddColumn(#"Level 2", "Approver 1 blank", each if Number.IsOdd([Index]) then "" else [Approver 1]),
#"Added Custom" = Table.AddColumn(#"Approver 1", "Approver 2 blank", each if Number.IsOdd([Index]) then "" else [Approver 2]),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Sub Project Blank", "App Group name Blank", "Level 1 blank", "Level 2 blank", "Approver 1 blank", "Approver 2 blank"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Other Columns",{{"Sub Project Blank", "Sub Project"}, {"App Group name Blank", "App Group name"}, {"Level 1 blank", "Level 1"}, {"Level 2 blank", "Level 2"}, {"Approver 1 blank", "Approver 1"}, {"Approver 2 blank", "Approver 2"}})
in
#"Renamed Columns"

Anonymous
Not applicable

Hi,

 

 Not sure what you are trying to achieve? Whats your desired output from the grouping?

 

Thanks,

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.