Forum Discussion

alhyde's avatar
alhyde
New Member
9 years ago
Solved

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!

4 Replies

  • Vvelarde's avatar
    Vvelarde
    Community Champion

    alhyde

     

    Try with:

     

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

    • JRadical's avatar
      JRadical
      New Member

      What if one of these tables is a measure?

       

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

  • v-micsh-msft's avatar
    v-micsh-msft
    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