cancel
Showing results for 
Search instead for 
Did you mean: 
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

@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.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Thanks @Seth_C_Bauer 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,

@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


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors