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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
DoubleEx
New Member

Filter last "n" days from user interface

Hi,

I simply want to give the user option to pick how many days back is data is displayed on their report. For example, show production for the last 5 days. I know how to do this in the dataset query but I want this to be variable based on operator choice. Any way to do this?

 

Thanks

 

4 REPLIES 4
Anonymous
Not applicable

@DoubleEx You can do this by using a slicer on the report page. They can select any date/day you set up for them. Here is an explanation if you aren't familiar with the concept.

Thanks @Anonymous I understand the slicer and tried to come up with a nice way to configure it to only display the last 7 days out of 3 years of dates. For example, I can create a query that "Filters Rows" on the date column using "in the previous 7 days" and it will create a nice sub-set of data for the last seven days. I could use that query in my report but I'd rather the logic be in the slicer and not create another query that needs to be maintained.

 

I was hoping to have a Power BI tab that is using the same 3 year dataset/query but filter for the last 7 days. Avoiding the need to have 2 queries and the need to update the dataset to get the correct data.  

 

Thanks 

 

 

 

 

Hi @DoubleEx,

 

Currently, it's not supported to custom a query within a slicer. It can only load entire dataset into slicer for filtering data. But you can use some custom visuals (like "TimeLine", "Advanced Time Slicer") to apply a date range in your slicer. It will be better usage for your scenario.

 

Regards,

Anonymous
Not applicable

@DoubleEx Have you checked out the custom visual "Timeline" - https://app.powerbi.com/visuals/ this slicer just takes an input of Date and allows you to select any number of variations on day/month/qtr/year without having to define additional calculated columns or multiple slicers

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.