Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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:
Product | Month | Amount |
GG-001 | Jan-22 | 6,759 |
GG-001 | Feb-22 | 6,323 |
GG-001 | Mar-22 | 5,915 |
GG-001 | Apr-22 | 5,534 |
GG-001 | May-22 | 5,177 |
GG-001 | Jun-22 | 4,843 |
GG-001 | Jul-22 | 4,531 |
GG-001 | Aug-22 | 4,239 |
GG-001 | Sep-22 | 3,965 |
GG-001 | Oct-22 | 3,710 |
GG-001 | Nov-22 | 3,470 |
GG-001 | Dec-22 | 3,247 |
GG-001 | Jan-23 | 3,037 |
GG-001 | Feb-23 | 2,841 |
GG-001 | Mar-23 | 2,658 |
GG-001 | Apr-23 | 2,487 |
GG-001 | May-23 | 2,326 |
GG-001 | Jun-23 | 2,176 |
GG-001 | Jul-23 | 2,036 |
GG-001 | Aug-23 | 1,905 |
GG-001 | Sep-23 | 1,782 |
GG-001 | Oct-23 | 1,667 |
GG-001 | Nov-23 | 1,559 |
In my example the results must be:
QT | Sum Last 4 Qt | Note |
Sep-23 | 9,863 | Sum (Sep23, Jun23, Mar23, Dec22) |
Jun-23 | 12,046 | Sum (Jun23, Mar23, Dec22,Jun22) |
Variation | (2,183) |
I reaaly appreciate your help
Solved! Go to Solution.
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
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
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.