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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.