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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
npombo
Helper I
Helper I

Finding earliest date given a value in another column

Hello,

 

I am having trouble creating a measure that takes the earliest date based on a value in another column. To break it down in simpler terms, let's call the referenced column "Status" and the two possible values are "Yes" or "No", and in this case we are filtering for "Yes". The date column will be called "date".

 

So far, I've been successful with writing a measure that takes the earliest date column using the MIN function:

Measure1 = MIN('Table Name'[Date])

 

I've tried incorporating the Status = "Yes" component of the measure as well with no luck. Here are some instances I've tried:

Measure2 = MIN(FILTER('Table Name', 'Table Name'[Status] = "Yes"))

Measure3 = MIN('Table Name'[Date], FILTER 'Table Name', 'Table Name'[Status] = "Yes")

Measure4 = FILTER('Table Name', 'Table Name'[Status] = "Yes", MIN('Table Name'[Date]))

 

Perhaps the FILTER function isn't the way to go here. Any feedback is appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @npombo ,

 

Please use calculate() function to wrap the filter() formula.

For example:

measure = calculate(min([date]),filter(allselected('table'),[status]="Yes"))

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
npombo
Helper I
Helper I

Hi Jay, this worked! Thank you for assisting me.

Anonymous
Not applicable

Hi @npombo ,

 

Please use calculate() function to wrap the filter() formula.

For example:

measure = calculate(min([date]),filter(allselected('table'),[status]="Yes"))

 

Best Regards,

Jay

amitchandak
Super User
Super User

@npombo , try like

 

Measure2 = MINX(FILTER(allselected('Table Name'), 'Table Name'[Status] = "Yes"), 'Table Name'[Date])

 

orr

 

Measure2 = MINX(FILTER(('Table Name'), 'Table Name'[Status] = "Yes"), 'Table Name'[Date])

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.