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! Request now

Reply
Anonymous
Not applicable

Summing Qty from two different data sources based on a second column in each data.

Hello everyone! 

 

I am trying to Sum Qty from two different data sources. The data sources both contain a column that has customer names. 

So i am trying to sum the Overall Qty per customer.

 

Here i have an example. I tried using the quick messure to add qty on qty but that only worked overall not for individual customers. 

 

powerbi vandamál.PNG

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try to create a distinct dimension table and create relationships among them:

DimensionTable = DISTINCT(SELECTCOLUMNS('Test-1',"CustomerID",'Test-1'[CustomerID]))

10.PNG

Then create a measure to sum all Qty from two tables:

Measure = SUM('Test-1'[Qty])+SUM('Test-2'[Qty])

Choose [CustomerID] from DimensionTable and this measure as a table visual, it shows:

12.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

2 REPLIES 2
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try to create a distinct dimension table and create relationships among them:

DimensionTable = DISTINCT(SELECTCOLUMNS('Test-1',"CustomerID",'Test-1'[CustomerID]))

10.PNG

Then create a measure to sum all Qty from two tables:

Measure = SUM('Test-1'[Qty])+SUM('Test-2'[Qty])

Choose [CustomerID] from DimensionTable and this measure as a table visual, it shows:

12.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

amitchandak
Super User
Super User

Create a common dimension and join both tables with that.

You can create like

customer = distinct(union(all(table1[customer ]),all(table2[customer ])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Top Solution Authors