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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Power BI Query Dynamic Filter

HI,

 

Hope you are doing well. I have a small query in Power BI.

 

Data source: Oracle SQL in import mode.

 

My customer wants to create a filter based on a date that only shows the data for yesterday and today's date.

So for example :

If we have a date column from 01/01/2019 ----31/12/2020

 

The customer should see only 31/12/2020 and the day before ( 30/12/2020) by default.

And after that, if they want they can move the filter and changes the date to see the historical data. (The data from previous years: 2019)

I managed to make that filter by the logic: Max date and Max Date-1 but for a moment it is static and not dynamic.The filter should be on creation dateThe filter should be on creation date

 

 

The filter should be on the creation date.

 

Any idea how to achieve this?

 

Thanks 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

 

You cannot make the data dynamic change to latest 2 days by default meanwhile allow you to change to others dates. 

 

For your requirement, you may follow the workaround:

1. Create 2 same tables.

2. Set a visual filter with TOP N filter to one table, the table will always display the latest 2 days' data.

3. Using the "Edit Interaction" feature to turn off the interaction between the Slicer and the filtered table.

4. You just the Slicer to change to others dates to show corresponding data in the other table.

 

TOP N and change dates.JPG

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@Anonymous 

 

You cannot make the data dynamic change to latest 2 days by default meanwhile allow you to change to others dates. 

 

For your requirement, you may follow the workaround:

1. Create 2 same tables.

2. Set a visual filter with TOP N filter to one table, the table will always display the latest 2 days' data.

3. Using the "Edit Interaction" feature to turn off the interaction between the Slicer and the filtered table.

4. You just the Slicer to change to others dates to show corresponding data in the other table.

 

TOP N and change dates.JPG

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.