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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

12 month rolling chart with Month Slicer

I have a model as shown below

timEalll_0-1671211881094.png

 

I created a visual below. I added filter Reporting Period for 12 months on the filter panel.

timEalll_1-1671211902795.png

I want to create a 12 month rolling chart with a slicer month. I want the slicer MonthYear to filter the chart based on the monthyear selected back to 12 month rolling. For example, when I select Dec-22 on the slicer, then I want the visual to filter from Dec-22 to Nov-21 (12 months).

How can I achieve this? 

 

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
sturlaws
Resident Rockstar
Resident Rockstar
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Access Denied message.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
sturlaws
Resident Rockstar
Resident Rockstar

Hi, @Anonymous,

 

You need a separate, unconnected date table. Remove the relative filtering on your measure.

 

Write a measure like this:

Measure1 =
VAR _date_unconnected =
    CALCULATE ( SELECTEDVALUE ( 'Dates unnconnected'[month] ) )
VAR _date =
    CALCULATE ( SELECTEDVALUE ( Dates[Month] ) )
RETURN
    IF (
        ISBLANK ( _date_unconnected ),
        SUM ( sales[sales] ),
        CALCULATE (
            SUM ( sales[sales] ),
            FILTER (
                ALL ( Dates ),
                _date >= ( _date_unconnected - 365 )
                    && _date <= _date_unconnected
                    && Dates[Month] = _date
            )
        )
    )

 

where month is the first day of every month.

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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