Forum Discussion

jaltoft's avatar
jaltoft
Icon for Resolver I rankResolver I
3 years ago
Solved

Rolling 12 months %

Hello,   Can someone please help? This is what I need (Ideally with the rolling showing accross a longer period but this is just a sample)- YYYYMM under 1hr Total In month % Rolling 12 % ...
  • DataInsights's avatar
    3 years ago

    jaltoft,

     

    Try this measure. The tables have a relationship on the date column. The visual uses DimDate[YYYYMM].

     

    Rolling 12 Month % = 
    VAR vUnder1Hour =
        CALCULATE (
            SUM ( FactTable[under 1hr] ),
            DATESINPERIOD ( DimDate[Date], MAX ( DimDate[Date] ), -12, MONTH )
        )
    VAR vTotal =
        CALCULATE (
            SUM ( FactTable[Total] ),
            DATESINPERIOD ( DimDate[Date], MAX ( DimDate[Date] ), -12, MONTH )
        )
    VAR vResult =
        DIVIDE ( vUnder1Hour, vTotal )
    RETURN
        vResult