Forum Discussion

jayceeb's avatar
jayceeb
Helper I
3 years ago
Solved

Variance between filtered date

Hi, How to get the variance for filtered dates. example :   Date Total Jan 5477604 Feb 5469004     Variance -8,600      
  • tamerj1's avatar
    tamerj1
    3 years ago

    jayceeb 

    Please try

    Variance =
    VAR MaxMonth =
    MAX ( MonthsF[YearMonth] )
    VAR MinMonth =
    MIN ( MonthsF[YearMonth] )
    VAR MaxMonthValue =
    CALCULATE ( SUM ( Consumptions[Total] ), MonthsF[YearMonth] = MaxMonth )
    VAR MinMonthValue =
    CALCULATE ( SUM ( Consumptions[Total] ), MonthsF[YearMonth] = MinMonth )
    RETURN
    MaxMonthValue - MinMonthValue