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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
vincenardo
Helper I
Helper I

Find Earliest Date on Filtered Set of Values in Table

I need to find the earliest date in my data, for Each Job No and PhaseID but exclude from my result any dates that are 12/30/1899.

 Here is a sample of my data -

 

2022-05-22_6-00-49.png

 

I have tried various solutions, but none seam to provide the result. I was able to get the result be creating a new column called 'SchedStartDateFiltered' which uses a conditional statement to return the ScheduledStartDate or blank if = 1899 and then use a measure formula, but I need to create this as a column with a DAX statement so I can use it in my matrix table.

 

Help is appreciated!

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@vincenardo 

you can also try this

Column = MINX(FILTER('Table','Table'[schedulestartdate]<>date(1899,12,30) && 'Table'[jobno]=EARLIER('Table'[jobno])&&'Table'[phaseid]=EARLIER('Table'[phaseid])),'Table'[schedulestartdate])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@vincenardo 

you can also try this

Column = MINX(FILTER('Table','Table'[schedulestartdate]<>date(1899,12,30) && 'Table'[jobno]=EARLIER('Table'[jobno])&&'Table'[phaseid]=EARLIER('Table'[phaseid])),'Table'[schedulestartdate])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




If I want to do the same but only filter on Job No and not inclde Phase ID, can you provide me the adjustment? The solution you provided works perfectly, I just want the option. Thanks!

@vincenardo 

you can try this

 

Column = MINX(FILTER('Table','Table'[schedulestartdate]<>date(1899,12,30) && 'Table'[jobno]=EARLIER('Table'[jobno])),'Table'[schedulestartdate])

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




hnguy71
Super User
Super User

Hi @vincenardo ,

 

Please try this as a measure:

MinDate = CALCULATE(MIN(YOUR_TABLE[ScheduleStartDate]), ALLEXCEPT(YOUR_TABLE,YOUR_TABLE[Job No]),YOUR_TABLE[ScheduleStartDate] <> DATE(1899, 12, 30))

 

Alternatively, you can do the same in a calculated column:

MinDate = CALCULATE(MIN(YOUR_TABLE[ScheduleStartDate]), FILTER(YOUR_TABLE, YOUR_TABLE[Job No] = EARLIER(YOUR_TABLE[Job No]) && YOUR_TABLE[ScheduleStartDate] <> DATE(1899, 12, 30)))

 

Let me know if that works out for you. 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 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.