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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AngelArteagaH
New Member

Sum base on multiple columns from another table

Hi Everyone!

I cannot figure out how to sum column Invoiced Quantity from Last Quarter Sales table into my Inventory table based on the ProductCode and LocationCode conditions

 

Currently I have:

 

question.png

 

 

I am not able to calculate the "Last Quarter Sales" column. Any tips? I have tried something like this:

Last Quarter Sales =
SUMX (FILTER (
LastQuarterSales,
LastQuarterSales[ProductCode] = Inventory[ProductCode]
&& LastQuarterSales[LocationCode] = Inventory[LocationCode]
),
LastQuarterSales[Invoiced Quantity]
)

 

But I had a circular dependency error.

 

Thanks.

 

1 ACCEPTED SOLUTION
themistoklis
Community Champion
Community Champion

Hello @AngelArteagaH 

 

I created a new column on both tables which concatenates ProductCode and LocationCode.

 

The new column was created using Power Query.

 

Then Joined the tables on this column (1 to many relationship).

 

Finally I created a simple sum formula to get the last quarter sales.

 

PowerBI file attached

View solution in original post

2 REPLIES 2
themistoklis
Community Champion
Community Champion

Hello @AngelArteagaH 

 

I created a new column on both tables which concatenates ProductCode and LocationCode.

 

The new column was created using Power Query.

 

Then Joined the tables on this column (1 to many relationship).

 

Finally I created a simple sum formula to get the last quarter sales.

 

PowerBI file attached

Thanks, it works like a charm

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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