Forum Discussion

tamdo95's avatar
tamdo95
Frequent Visitor
5 years ago
Solved

Running Total with Condition

Hi everyone, I'm creating a measure to calculate a running total with different conditions. Specifically, when Condition 1 is blank, Total should be 0, then Running Total is calculated with the pe...
  • wdx223_Daniel's avatar
    5 years ago
    Test_Running_Total = CALCULATE(sumx(values(calendar[yearmonth]),if([condition1],[total])),DATESBETWEEN (
    'Calendar'[Date],
    DATEADD (
    NEXTDAY ( LASTDATE( 'Calendar'[Date] ) ),
    -1
    * IF (
    HASONEVALUE ( 'Period'[Period] ),
    MAX ( 'Period'[Period] ),
    12
    ),
    MONTH
    ),
    MAX( ( 'Calendar'[Date] )
    )
    ))