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 August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Rolling 24 months date slicer to remove scrolling

Hi all. I have a report with a Matrix visualization that is being filtered by a date Slicer with slider. There is a lot of data (46 years worth), and so there is a lot of horizontal scrolling. I want to remove the scrollbar by filtering the Matrix in such a way that we only ever see a rolling 24 months on the screen at any time, controlled by the slider on the date Slicer. Ideally we see 12 months before and 12 months after the selected date. Please see screenshot, and thank you in advance.

 

Slider currently shown with "Between" optionSlider currently shown with "Between" option

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I did a simple sample and you can check the results as follows.

vtianyichmsft_0-1718072110006.png

vtianyichmsft_1-1718072123569.png

Measure = var _s = MIN('Table'[Date])
var _max = EDATE(_s,24)
RETURN IF(MAX('Date'[Date])>=_s&&MAX('Date'[Date])<=_max,1,0)

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

 

I did a simple sample and you can check the results as follows.

vtianyichmsft_0-1718072110006.png

vtianyichmsft_1-1718072123569.png

Measure = var _s = MIN('Table'[Date])
var _max = EDATE(_s,24)
RETURN IF(MAX('Date'[Date])>=_s&&MAX('Date'[Date])<=_max,1,0)

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you @Anonymous Scott,

 

Please see screenshot below. As you can see, I am unable to add a measure to the Columns for the Matrix. I can see that you were able to get it to work on a Line Chart and a Table, however? Please advise, and thank you for your help.

Screenshot 2024-06-11 074044.png

Anonymous
Not applicable

Hi @Anonymous ,

 

Sorry for late reply.You can use Line and stacked column chart.And set measure as Line y-axis.

 

Best regards,
Community Support Team_ Scott Chang

amitchandak
Super User
Super User

@Anonymous , check if this approach can help, I have done it for rows, you need it for columns

Throwback- Mastering Pagination in Power BI Visuals using Window Functions: A Step-by-Step Guide, How to do it- https://www.youtube.com/watch?v=a_tgxuIdM-o&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks @amitchandak. This is an intriguing possibility, but I am having trouble making it work for the matrix visualization. I'll keep trying.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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