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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.