Forum Discussion
Anonymous
7 years agoNot applicable
DYNAMIC FILTER - CURRENT MONTH + PREV MONTH
Hi Community,
Need your support on the following challenge. I would like to get a calculated column that would update its values according to the month where the calendar in the dashboard. Issue is that apparently this function does not allow to FILTER by text and date
Horas_Prev_Month = CALCULATE(SUM(t_Planeamento[Horas]);
FILTER(t_Planeamento; t_Planeamento[Planeamento] = "Variação");
FILTER(t_Planeamento; t_Planeamento[Data] = [CurrentMonth])
)
Anyone can help me to achieve this ?
Thank you all!
NM
Hi Anonymous
You may try below measure:
Horas_Current_Month = CALCULATE ( SUM ( t_Planeamento[Horas] ), FILTER ( t_Planeamento, t_Planeamento[Planeamento] = "Variação" ), FILTER ( t_Planeamento, MONTH ( t_Planeamento[Data] ) = [CurrentMonth] ) )Horas_Prev_Month = CALCULATE ( SUM ( t_Planeamento[Horas] ), FILTER ( t_Planeamento, t_Planeamento[Planeamento] = "Variação" ), FILTER ( t_Planeamento, MONTH ( t_Planeamento[Data] ) = [CurrentMonth]-1 ) )Regards,
Cherie
2 Replies
- v-cherch-msft
Microsoft Employee
Hi Anonymous
You may try below measure:
Horas_Current_Month = CALCULATE ( SUM ( t_Planeamento[Horas] ), FILTER ( t_Planeamento, t_Planeamento[Planeamento] = "Variação" ), FILTER ( t_Planeamento, MONTH ( t_Planeamento[Data] ) = [CurrentMonth] ) )Horas_Prev_Month = CALCULATE ( SUM ( t_Planeamento[Horas] ), FILTER ( t_Planeamento, t_Planeamento[Planeamento] = "Variação" ), FILTER ( t_Planeamento, MONTH ( t_Planeamento[Data] ) = [CurrentMonth]-1 ) )Regards,
Cherie
- AnonymousNot applicable
Thank you very much Cherie!