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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Asantos2020
Advocate II
Advocate II

Difference between Measures from Different Tables

Hello,

 

The challenge here consists of finding the difference between the measures below:

Overview Table

ProductCostPlant
Item11.00Plant A
Item12.00Plant B
Item22.50Plant A
Item22.30Plant B
To find the cost per product, per plant:
Cost Plant A = CALCULATE(SUM('OverviewTable'[Cust]);'Overview'[Plant]="Plant A")
Cost Plant B = CALCULATE(SUM('OverviewTable'[Cust]);'Overview'[Plant]="Plant B")

 

Cost Table

ProductCost
Item11.10
Item21.90
Item32.30
Cost ERP = SUM(Cost Table[Cost])
 
I now need to find the difference between costs for a product and plot it on a line chart.
 
The relationship is as follows:
Product Table filters Overview Table
Product Table filters Cost Table
 
I've tried just subtracting one by another, but it gives me like 795 on a certain month, even though I got the visual filtered on a specific product.
The cost / product / plant and the Production Cost are plotted correctly, but not the difference measure I'm trying to come up with.
 
Thanks for your help!
3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

Hi, @Asantos2020 

And you want have the difference between costs for a product, what about the Plant A or B.

Could provide the pbix if possible, so I can create something similar to yours and help your out. 

Best,
Paul

Hello @V-pazhen-msft !

 

I would then need to find the differences between:

Cost ERP = SUM(Cost Table[Cost])

and 

Cost Plant A = CALCULATE(SUM('OverviewTable'[Cust]);'Overview'[Plant]="Plant A")
 
and also between:
Cost ERP = SUM(Cost Table[Cost])
and 
Cost Plant B = CALCULATE(SUM('OverviewTable'[Cust]);'Overview'[Plant]="Plant B")
 
...and have these differences plotted as tooltip.
 
Not sure if this is too much to ask without the file. If so, I'll have to create the datasets, as the one I'm working on contains confidential data.
 
Thanks. Cheers!
Antonio

@Asantos2020 

I find no problem with the difference with the sample I created based on your original post.
difference AB & ERP.JPG

Please create a sample pbix that similar to your dataset, including the related columns and relationship between tables,

Paul


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