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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
padinator
Helper I
Helper I

Create sum of Expanded Table Column (number) after NestedJoin

Hello there!

 

I have the following problem. I am Joining two tables in the classical way by "OrderNo".

As i am joining these tables (LeftOuterJoin) i get several matching records in the second table so i usually have a 1:n relation between the joined tables.

Now, what I want to achieve is that as I expand just ONE single column of table 2 (which is an AMOUNT Column) and (as i mentioned) there are more than one matches - i do no want to get "n" identical rows but instead i want to Sum up this record into the Column i am currently expandig.

 

I hope you get my point but for further illustration lets say i have these two tables

Table 1

OrderNoItemID
1234ABCXXXX
   

Table2

OrderNoSalesAmountCostAmount
123410050
12345020
   

 

As i join Table1 with Table2 based on OrderNo and then expand lets say SalesAmount - i want to still have a single record containing the summed up amount of 150 instead of two identical records with each 100 and 50 within the expanded SalesAmount col.

 

Any hint would be highly appreciated!

 

Greets!

1 ACCEPTED SOLUTION
Thingsclump
Resolver V
Resolver V

Hi @padinator 

 

Below screenshot shows a solution. You actually don't have to expand also after join.

 

Table 2 column is created after merge which is shown in preview at the bottom.

 

Sales amount total column is created using list.sum.

 

Thingsclump_0-1639141749462.png

 

Thanks,

thingsclump

www.thingsclump.com 

View solution in original post

3 REPLIES 3
Thingsclump
Resolver V
Resolver V

Hi @padinator 

 

Below screenshot shows a solution. You actually don't have to expand also after join.

 

Table 2 column is created after merge which is shown in preview at the bottom.

 

Sales amount total column is created using list.sum.

 

Thingsclump_0-1639141749462.png

 

Thanks,

thingsclump

www.thingsclump.com 

I havr to try this out on monday because i do not merge my tables in another table but do a nested join instead where i have to ExpandTableColumn afterwards which is automatically generating x lines of Table 1 - based on the No. of Matches (n) Table 2 has with it

padinator
Helper I
Helper I

One Solution would be to simply group the Columns back and create a sum by

 

= Table.Group(#"Erweiterte NAV Wertposten1",{"Entry No_", "Spedition", "Promised Delivery Date", "Customer No_", "Country", "ZIP Code", "Delivery Address", "Item Weight", "STP Spedition", "Item No_", "Quantity", "Cost", "Cost Type", "Order No_", "Pallets", "Packages", "Package Weight", "Lagerkosten", "Inventory Period", "KT Code", "KT Dim Code", "KT Name", "Marke Code", "Marke Dim Code", "Marke Name", "KTID", "MarkeID"},{"total", each List.Sum([Umsatz])})

 

Anyway, i am wondering if there is a more efficient way to do this since this takes a whole lot of time to calculate and i guess it is not very efficient.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors