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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
gomezc73
Helper V
Helper V

How Filter only amounts of Quarters (March, Jun, September, December)

Hi Experts,

 

 I am trying to get the amounts only of the months March, June, September, December ( Quarters) from a table with all months, because the user needs compare a consolidated of the last 4 quarters.

 

 By Example,

 

 If the user wants to compare September 2023 Vs June 2023, i need:

 

 For September 2023: Sumarize the amounts of (September 2023, June 2023, March 2023 and December 2022)

 

 For June 2023: Sumarize the amounts of (June 2023, March 2023, December 2022 and September 2022)

 

 With the results I need get the variation September 2023 Vs June 2023.

 

  My problem is that in my tables i have the amounts for all months of the year

  By eaxmple:

   

ProductMonthAmount
GG-001Jan-22                       6,759
GG-001Feb-22                       6,323
GG-001Mar-22                       5,915
GG-001Apr-22                       5,534
GG-001May-22                       5,177
GG-001Jun-22                       4,843
GG-001Jul-22                       4,531
GG-001Aug-22                       4,239
GG-001Sep-22                       3,965
GG-001Oct-22                       3,710
GG-001Nov-22                       3,470
GG-001Dec-22                       3,247
GG-001Jan-23                       3,037
GG-001Feb-23                       2,841
GG-001Mar-23                       2,658
GG-001Apr-23                       2,487
GG-001May-23                       2,326
GG-001Jun-23                       2,176
GG-001Jul-23                       2,036
GG-001Aug-23                       1,905
GG-001Sep-23                       1,782
GG-001Oct-23                       1,667
GG-001Nov-23                       1,559

 

In my example the results must be:

QTSum Last 4 QtNote
Sep-23                 9,863Sum (Sep23, Jun23, Mar23, Dec22)
Jun-23               12,046Sum (Jun23, Mar23, Dec22,Jun22)
Variation               (2,183) 

 

I reaaly appreciate your help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @gomezc73,

You can try to use following measure formula if helps. I extract the current date as condition to filter on the date range from last year same period to current and add MOD function only picked the month number that can be divisible by 3.

formula =
VAR currDate =
    MAX ( Table1[Month] )
RETURN
    CALCULATE (
        SUM ( Table1[Amount] ),
        FILTER (
            ALLSELECTED ( Table1 ),
            AND (
                Table1[Month]
                    >= DATE ( YEAR ( currDate ) - 1, MONTH ( currDate ), DAY ( currDate ) ),
                Table1[Month] <= currDate
            )
                && MOD ( MONTH ( Table1[Month] ), 3 ) = 0
        ),
        VALUES ( Table1[Product] )
    )

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @gomezc73,

You can try to use following measure formula if helps. I extract the current date as condition to filter on the date range from last year same period to current and add MOD function only picked the month number that can be divisible by 3.

formula =
VAR currDate =
    MAX ( Table1[Month] )
RETURN
    CALCULATE (
        SUM ( Table1[Amount] ),
        FILTER (
            ALLSELECTED ( Table1 ),
            AND (
                Table1[Month]
                    >= DATE ( YEAR ( currDate ) - 1, MONTH ( currDate ), DAY ( currDate ) ),
                Table1[Month] <= currDate
            )
                && MOD ( MONTH ( Table1[Month] ), 3 ) = 0
        ),
        VALUES ( Table1[Product] )
    )

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors