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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.