Forum Discussion

TheITAnalyst13's avatar
TheITAnalyst13
Frequent Visitor
8 years ago
Solved

DAX Formula for subtracting columns?

Hi All,   I'm trying to subtract the value of 2 columns in such a way as below:   Column A Column B Column C Column D A 0 8 SUM(B2:B3)-SUM(C2:C3) A 3 0 C 0 10 SUM(B4:B5)-SU...
  • v-yulgu-msft's avatar
    v-yulgu-msft
    8 years ago

    Hi TheITAnalyst13,

     

    That case, you could new a calculated table with below DAX formula:

    Tb2 =
    SUMMARIZE (
        Tb1,
        Tb1[Column A],
        "ColumnB", SUM ( Tb1[Column B] ),
        "ColumnC", SUM ( Tb1[Column C] ),
        "ColumnD", SUM ( Tb1[Column B] ) - SUM ( Tb1[Column C] )
    )

     

    Best regards,

    Yuliana Gu