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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
Anonymous
Not applicable

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

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

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?



Follow on LinkedIn
@ 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!:
DAX For Humans

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?

Anonymous
Not applicable

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

Thank you so much!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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