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
alhyde
New Member

DAX Formula for subtracting columns?

I am trying to caluculate current year revenue(column C) by subtracting prior revenue (column B) from revenue to date (column A).  In theory, the formula would be A - B = C.  Would I use some form of SUM formula to subtract these?  I'm new to Power BI and need help, please!  I've worked on this several hours, with little success.  All suggestions are welcome!

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@alhyde

 

Try with:

 

C=Calculate (Sum(Table[A]))-Calculate (Sum(Table[B]))




Lima - Peru

View solution in original post

4 REPLIES 4
v-micsh-msft
Microsoft Employee
Microsoft Employee

Hi alhyde,

 

What is your current situation?

The formula provided by Vvelarde should have the same results with the formula below:

C = A - B

 

Adding a blog for reference:

Understanding Context Transition

If that formula didn't meet your requirements, then please post back.

Regards

Vvelarde
Community Champion
Community Champion

@alhyde

 

Try with:

 

C=Calculate (Sum(Table[A]))-Calculate (Sum(Table[B]))




Lima - Peru

What if one of these tables is a measure?

 

Can you do C = A - B if B is [B]?

@Vvelarde thanks for the solution!  It worked!

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.