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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.