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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.