Forum Discussion
Variance between filtered date
- 3 years ago
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
Hi, I have a Date table shown below.
however I don't know how to get the variance. I'm using only one column for date and I want to select between months. please help
- tamerj13 years agoCommunity Champion
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- jayceeb3 years agoHelper I
It works. Thank you very much ğŸ˜
- jayceeb3 years agoHelper I
Hi could you please help with the percentage. for this calculated months?
- tamerj13 years agoCommunity Champion
jayceeb
Do yu mean something like this?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 DIVIDE ( MaxMonthValue - MinMonthValue, MaxMonthValue )