Forum Discussion

Giada90's avatar
Giada90
Helper IV
4 years ago
Solved

problem with a calculation

Hi,  I have a table with two fields like this: type value A 10 B 3   I need to make a measure that subtracts value A from value B Which dax formula can I use? Thanks
  • ddpl's avatar
    ddpl
    4 years ago

    Giada90 try this

     

    Measure 2 = var _A = CALCULATE(SUM('Yourtable'[value]),'Yourtable'[type] = "A")

    var _B = CALCULATE(SUM('Yourtable'[value]),'Yourtable'[type] = "B")

    return

    (_A - _B)
  • Giada90's avatar
    Giada90
    4 years ago

    thanks!