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

How to substract two values from two tables (many to many) by using Dax

Hi all,

 

I have two tables with many to many relationship

One is actualized numbers, broken down by equipment and month (table a column a) and the other one is forecast number (table b column b) with the same breakdown.

I want to create a measure to subtract columns a and b. It needs to be able to drill down by equipment level.

Does anyone know how should I go about doing it?

I tried to write something like below, but it doesn't work. I guess is because of the many to many relationship..

Calculate(Sum('table a'column a) - Sum('table b' column b)) 

 

 

Thanks

JPY

 

 

 

 

 

1 REPLY 1
amitchandak
Super User
Super User

@JPY , create a bridge table /common dimension table like equipment. date and analyze against them

https://www.seerinteractive.com/blog/join-many-many-power-bi/

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

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.