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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Dynamic Filter using measure

Hi All,

My source is excel and the data is number of items (count) for each day. I have the counts on a score card. Since it is bringing sum of all the days i added a date filter and choose the latest date from the drop down. I want to do away with this manual selection of the latest dayte every time. I was wondering if there is an easy way , like the filter defaults to the latest data from the excel sheet. I tried creating a measure (max(date)) but there is no option where i can use it as a Filter. Please advice.

Thanks

 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

1. Mark the largest date.

v-lionel-msft_0-1606977140979.png

2. Set the maximum date as the default value.

v-lionel-msft_1-1606977219420.png

 

Each time the date column is updated, the slicer will select the maximum date by default.

The same is true for the solutions provided by @amitchandak@DataZoe 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

6 REPLIES 6
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

1. Mark the largest date.

v-lionel-msft_0-1606977140979.png

2. Set the maximum date as the default value.

v-lionel-msft_1-1606977219420.png

 

Each time the date column is updated, the slicer will select the maximum date by default.

The same is true for the solutions provided by @amitchandak@DataZoe 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

DataZoe
Microsoft Employee
Microsoft Employee

@Anonymous You can use this to have it mark the the latest date in a calculated column, then use that in a slicer:

 

Latest = if(financials[Date]=CALCULATE(max(financials[Date]),all(financials)),"Current","Past")
 
DataZoe_2-1606786756086.png

 

 
 
 
 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Anonymous
Not applicable

Thanks DataZoe ,  i want to clarify. First create a  measure and then use the IF condition? please explain.

Thanks

amitchandak
Super User
Super User

@Anonymous , Create a column like this in date table or table and filter that on MaxDate

 

Is max Date =
var _max = maxx(Table, Table[Date])
return
if('Date'[Date]=_max,"MaxDate",[Date]&"")

 

You can sort this on date column https://youtu.be/hfn05preQYA

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Can you please make it modular. For layman like me , 

Create a column --- which one is a new column from your example (Is max date = ???)

Then filter (?????) ok completely locst here , does this whole thing must be used in a filter

var _max = maxx(Table, Table[Date])
return
if('Date'[Date]=_max,"MaxDate",[Date]&"")

 

Thanks

Anonymous
Not applicable

Thanks Amitchandak,

I think my maxdate is not working, please see the attached screen shot and the calculation i used. My measure 

MAXDATE = MAXA(test[DATE])

Capture1201.PNG

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.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.