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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pantherfanrh
Frequent Visitor

Making a slicer or graph display X months back

Hi all!

 

I am trying to use Power BI to display a report that will show me the past X number of months from the point that I click. For instance, If I click Jan, 2016 in the slicer, it will display September 2015-Jan 2016 in the graph (or however many months back X is). I understand you can use drill down to display by the years, but that is not what I want it to do (as drill down will only show me the months in that year.) I tried using the timeline slicer, and that didn't help. Any help would be appreciated!

Thanks again!

1 ACCEPTED SOLUTION

Hi @pantherfanrh,

 

I'd like to suggest you add a calculate column to show the diff between current row and today. After create the column, you can  use this as the source of slicer(switch the mode to "Less than or equal to")

 

Calculated column formula:

 

Diff = DATEDIFF([Date],TODAY(),MONTH) 

 

Notice: you should turn on the preview feature "number range slicer" to enable the expand options.

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Could you create a measure that did the calculation of X back so that numbers would be like 1 for 1 month back, 2 for two months back, etc. and then just set your filter on your visual to be that measure < X months back?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

So something like

 

date=EDATE([workdate],13)

 

then set the filter to that measure?

 

I'm trying to use EDATE but it doesn't like it when I use my column of dates in the table. Any advice?

Hi @pantherfanrh,

 

I'd like to suggest you add a calculate column to show the diff between current row and today. After create the column, you can  use this as the source of slicer(switch the mode to "Less than or equal to")

 

Calculated column formula:

 

Diff = DATEDIFF([Date],TODAY(),MONTH) 

 

Notice: you should turn on the preview feature "number range slicer" to enable the expand options.

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you so much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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