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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply

Rolling N months growth %

Hello,
i am using SQLBI Rolling 6 months formula, you can that method here - https://www.youtube.com/watch?v=d8Rm7dwM6gc&t=1010s
Last 6 Months =

CALCULATE(
    [RRP],
    DATESINPERIOD(
        Dim_Date[Date],
        EOMONTH(MAX('Dim_Date Duplicate'[Date]), -1),  -- Exclude the max (latest) month by using EOMONTH
        -6, MONTH   -- Get the last 6 months (from the month before the max month),
    ),
    KEEPFILTERS(Dim_Date),
    REMOVEFILTERS('Dim_Date Duplicate'),
    USERELATIONSHIP(Dim_Date[Date], 'Dim_Date Duplicate'[Date])
    )
and accordingly
Sameperiodlastyear = 
CALCULATE(
    [RRP],
    SAMEPERIODLASTYEAR(
        DATESINPERIOD(
            Dim_Date[Date],
            EOMONTH(MAX('Dim_Date Duplicate'[Date]), -1),  -- Exclude the max (latest) month by using EOMONTH
            -6, MONTH   -- Get the last 6 months (from the month before the max month)
        )
    ),
    KEEPFILTERS(Dim_Date),
    REMOVEFILTERS('Dim_Date Duplicate'),
    USERELATIONSHIP(Dim_Date[Date], 'Dim_Date Duplicate'[Date])
 
 
)
Expected result
Oct-241512
Nov-245026
Dec-244030
Jan-254540
Feb-253442
Mar-252030

Result i am getting is 
23-Oct 12
23-Nov 26
23-Dec 30
Jan-24 40
Feb-24 42
Mar-24 30
Oct-2415 
Nov-2450 
Dec-2440 
Jan-2545 
Feb-2543 
Mar-2520 



4 REPLIES 4
rohit1991
Super User
Super User

Hi @Hemant_Jaiswar ,

Based on your scenario and the discrepancy you're seeing between the expected and actual results, the issue likely stems from how SAMEPERIODLASTYEAR() handles dynamic rolling periods. It doesn’t always align correctly with rolling windows, especially when you're excluding the latest month and working with complex date relationships. Instead of using SAMEPERIODLASTYEAR, try manually shifting the window back by 12 months using EOMONTH(MAX('Dim_Date Duplicate'[Date]), -13) to define the start of the period for the previous year.

 

This method gives you direct control over the time frame and ensures that the same 6-month rolling window is applied to the prior year, improving alignment and accuracy. Bhanu Gautam's suggestion reflects this approach, and it's often more reliable in scenarios involving custom rolling date logic. Give that a try and see if the results match your expectations.

 

Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
v-veshwara-msft
Community Support
Community Support

Hi @Hemant_Jaiswar ,

Thanks for reaching out to Microsoft Fabric Community.

Just checking in to see if your issue has been resolved by now. If not, please consider the following:

 

For calculating the rolling 6-month growth and its same period last year value while excluding the latest month, using a manual 12-month shift to align the rolling window usually resolves the misalignment issues seen with SAMEPERIODLASTYEAR() on rolling periods.

 

Hope this helps. Please reach out for further assistance.

 

If you have found another solution that works, please share it here to help others.

Also, if any response helped you, kindly mark it as the accepted solution and consider giving kudos to assist others with similar queries.

Thanks,

Not giving the expected result.

bhanu_gautam
Super User
Super User

@Hemant_Jaiswar Try using

Sameperiodlastyear =
CALCULATE(
[RRP],
DATESINPERIOD(
Dim_Date[Date],
EOMONTH(MAX('Dim_Date Duplicate'[Date]), -13), -- Move back 13 months to get the same period last year
-6, MONTH -- Get the last 6 months (from the month before the max month)
),
KEEPFILTERS(Dim_Date),
REMOVEFILTERS('Dim_Date Duplicate'),
USERELATIONSHIP(Dim_Date[Date], 'Dim_Date Duplicate'[Date])
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.