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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Earliest Value based on filter/criteria

Hi, 

 

I have a dataset as follows:

 

IDDateSuccessScore
12311/19/202005
12311/20/202016
12311/21/202012
12211/19/202008
12211/20/202019
13311/19/202011
13311/20/202013
14411/19/202004

 

You'll notice that ID is a column with repeats with each row tracking the date and success and score. 

 

What I'm looking for is to be able to return the earliest known score for each unique ID where success is = 1. I would like to be able to populate the following (earliest_success_score). 

 

IDDateSuccessScoreEarliest_success_score
12311/19/202005null
12311/20/2020166
12311/21/202012null
12211/19/202008null
12211/20/2020199
13311/19/2020111
13311/20/202013null
14411/19/202004null

 

Thanks!

 

p.s. it's possible that there could be multiple submissions for a single day and the data has a time stamp in additiona to the date so the solution would look at earlist date and time (keeping the sample data simpler for ease of my understanding).

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create a new column like

Column = var _1 = minx(FILTER(Data, [ID] =EARLIER([ID]) && Data[Success] = 1),Data[Date])
return 
if(_1 =[date] ,minx(FILTER(Data, [ID] =EARLIER([ID]) && Data[Success] = 1 && [Date] =_1),[Score]),BLANK())
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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Create a new column like

Column = var _1 = minx(FILTER(Data, [ID] =EARLIER([ID]) && Data[Success] = 1),Data[Date])
return 
if(_1 =[date] ,minx(FILTER(Data, [ID] =EARLIER([ID]) && Data[Success] = 1 && [Date] =_1),[Score]),BLANK())
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

thanks @amitchandak ! your solution worked great. 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.