Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not 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 
1 ACCEPTED SOLUTION
v-cherch-msft
Employee
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

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-cherch-msft
Employee
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

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you very much Cherie!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.