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
PreetiSahu321
Helper I
Helper I

Subtract two columns from different table using DAX in power bi

Hello Power BI Community Members,

 

Recently, I was working with Power BI DAX. As per my requirement, I have to subtract two different columns of values from two different tables. Let me explain to you properly so that you can understand easily.

 

I have one table named: "Orders". This Orders table has one column as "Sales doc." whose data type is the Whole number. Similarly, I have another table named: "Sales" and this has another column as "Order" whose data type is the Whole number.

 

As per my requirement, I have to subtract the values from the Sales doc. (from Orders table) to Order (from the Sales table). As I am new to Power BI, I don't have any idea to subtract from different tables using DAX. Please, can anyone suggest to me what I have to do?

 

Thanks in Advance!!!

2 REPLIES 2
Nathaniel_C
Super User
Super User

Hi @PreetiSahu321 
If I understand your issue, try this.

Subtract measure = SUM(Orders[Sales Doc])-Sum(Sales[Order])

Sum and subtract.PNG

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Nathaniel_C ,

 

I have applied the formula and it is giving me the exact value. But one more thing I want to know is, there is one common column in both Orders and Sales tables i.e. BillDate (Date and Time Datatype). As per my requirement, I want to subtract the measure per monthly basis. Let me explain to you properly.

 

You can see below are two tables as Orders and Sales. I want to subtract the values from Net value to Sales US$ of the current month. As this is November month is going on, So it will subtract the values for the current month only. i.e. (132454-370.80=132,083.2)

 

1.png

 

Can you suggest me if anything I have to do else?

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