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
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
Employee
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
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.