Forum Discussion

hitesh1607's avatar
hitesh1607
Advocate II
6 years ago
Solved

Average on Measure

I have a measure to calculate the Rolling Count   RollingMeasure = VAR MaxDate = MAX ( 'Date'[Date] )  RETURN CALCULATE ( COUNT(fctTable[ID]),  fctTable[HireDate] <= MaxDate,  ALL ( Date)  )...
  • v-xuding-msft's avatar
    v-xuding-msft
    6 years ago

    Hi hitesh1607,

     

    Have you resolved it? If not, you could reference my way to have a try:

    RollingMeasure =
    CALCULATE (
        SUM ( 'Table'[Values] ),
        FILTER (
            ALL ( 'Date' ),
            'Date'[Date] <= MAX ( 'Date'[Date] )
                && 'Date'[Year] = MAX ( 'Date'[Year] )
        )
    )
    
    Avg =
    AVERAGEX (
        FILTER ( ALLSELECTED ( 'Date' ), 'Date'[Year] = MAX ( 'Date'[Year] ) - 1 ),
        [RollingMeasure]
    )
    

     

    If this can't help you, please share some sample data and expected result with us. Thanks.