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
CliffordAP
Helper II
Helper II

Measure to Calculate a sum across several related tables (Model/DAX)

Hello all,

I have a small puzzle I am trying to understand. I have a relational database where GLs are attributed to products and services.

Here is the model I have so far, and the relationships I have modeled:

CliffordAP_0-1638378172747.png

CliffordAP_1-1638378204159.png

The best I can do with this setup is the following visual:

CliffordAP_2-1638378275045.png

Since the balances for products and services are not on the same table, I cannot select them into the same column aligned with their respective GLs. Is there a way I can create a measure that will put these calculations into the same column?

What I have tried so far:

CliffordAP_4-1638378526313.png

Here I attempted to see if it would only show the sum across the products and not the services. But it bloated everything instead.


I am looking for something like:

CliffordAP_3-1638378453308.png

Is there a way I can accomplish this with a DAX measure? or is there some alternative method I can try in the model?
     *I would like to keep the product and service tables seperate from one another

     *I would like to attach the .pbix file with the model already in it, but I don't know how.
UPDATE:

CliffordAP_1-1638381041087.png

 

I can get it to do exactly what I want in DAX Studio, but the DAX query does not have the same output in the desktop application. 

Thank you!

1 ACCEPTED SOLUTION
CliffordAP
Helper II
Helper II

The filter context was activated in DAX Studio because the table argument was explicitly defined in the query. In Desktop it is not. Thus:

CALCULATE(SUM('Product'[Balance])+SUM('Service'[Balance]),'glFactTable')
Will work in PBI Desktop.

CliffordAP_0-1638466398987.png

Thank you me!

Your Welcome.. Me.

 

View solution in original post

1 REPLY 1
CliffordAP
Helper II
Helper II

The filter context was activated in DAX Studio because the table argument was explicitly defined in the query. In Desktop it is not. Thus:

CALCULATE(SUM('Product'[Balance])+SUM('Service'[Balance]),'glFactTable')
Will work in PBI Desktop.

CliffordAP_0-1638466398987.png

Thank you me!

Your Welcome.. Me.

 

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.

Users online (7,197)