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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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