Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Subtract rows from a total value

Hello everyone!

I need some help at this situation:

 

I need to subtract row values from a total value to adjust the column1, the desired value is in column2:

 

 

Can someone help me?

 

  • Anonymous Well, if everything are columns then that would be:

    Column 2 = if([column1] - [balance] <= 0, 0, [column1] - [balance])

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous This would be the one for Balance, what is the logic for Column2???

      Balance = 
        VAR __Total = 10000
        VAR __Month = MAX('Table'[Month])
        VAR __Table = FILTER(ALL('Table',[Month] <= __Month)
    RETURN
      __Total - SUMX(__Table,[Column1])
    • Anonymous's avatar
      Anonymous
      Not applicable

      Greg_Deckler ,

       

      The logic is: if(column1 - balance <= 0, 0, column1 - balance)

      • Greg_Deckler's avatar
        Greg_Deckler
        Icon for Community Champion rankCommunity Champion

        Anonymous Well, if everything are columns then that would be:

        Column 2 = if([column1] - [balance] <= 0, 0, [column1] - [balance])