Forum Discussion

cpdanielmc21's avatar
cpdanielmc21
Icon for Helper I rankHelper I
6 years ago
Solved

Calculate QTD from running total

Hi community I hope you can help me on this one. I have accounting data with amounts that come acumulated, and I need to calculate the QTD from it. Here is an example: Q1 - Revenue - 120 Q2 - Rev...
  • v-xuding-msft's avatar
    v-xuding-msft
    6 years ago

    Hi cpdanielmc21 ,

     

    I create two calculated columns that you could have a try.

     

    Current Amount =
    VAR lastrow =
        CALCULATE (
            MAX ( 'Table'[Amount] ),
            FILTER ( 'Table', 'Table'[Period] < EARLIER ( 'Table'[Period] ) 
                               && 'Table'[Year] = EARLIER ( 'Table'[Year] ))
        )
    RETURN
        'Table'[Amount] - lastrow
    
    QTD = TOTALQTD(SUM('Table'[Current Amount]),'Date'[Date])