Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to calculate difference between two rows in a table?

Hi everyone,   I need your help. I want to calculate the difference of Montant of C and D. Supposingly, I would like to subtract montant of C from montant of D. I want to display Difference i.e- 0....
  • selimovd's avatar
    5 years ago

    Hey Anonymous ,

     

    you can subtract one from the other:

    Difference Montant C to D =
    CALCULATE(
        SUM( myTable[Montant] ),
        myTable[Sens] = "D"
    )
    - CALCULATE(
        SUM( myTable[Montant] ),
        myTable[Sens] = "C"
    )

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis