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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MdJ83
Helper II
Helper II

Finding the earliest date between two colomns

Im looking to identify the earliest date between the two colomns in the same row.

 

Example data

Input Output
First StartSecond Start Date
15/03/202115/09/2022 15/03/2021
17/03/20211/03/2021 1/03/2021
1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @MdJ83 ,

Please have a try.

Create a column.

Column =
VAR first_date = 'Table'[First Start]
VAR second_date = 'Table'[Second Start]
RETURN
    IF ( first_date > second_date, second_date, first_date )

Or a measure.

Measure =
VAR start_1 =
    MAX ( 'Table'[First Start] )
VAR second_2 =
    MAX ( 'Table'[Second Start] )
RETURN
    IF ( start_1 > second_2, second_2, start_1 )

vpollymsft_0-1646635130016.png

Best Regards

Community Support Team _ Polly

 

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

3 REPLIES 3
v-rongtiep-msft
Community Support
Community Support

Hi @MdJ83 ,

Please have a try.

Create a column.

Column =
VAR first_date = 'Table'[First Start]
VAR second_date = 'Table'[Second Start]
RETURN
    IF ( first_date > second_date, second_date, first_date )

Or a measure.

Measure =
VAR start_1 =
    MAX ( 'Table'[First Start] )
VAR second_2 =
    MAX ( 'Table'[Second Start] )
RETURN
    IF ( start_1 > second_2, second_2, start_1 )

vpollymsft_0-1646635130016.png

Best Regards

Community Support Team _ Polly

 

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

 

 

 

Jihwan_Kim
Super User
Super User

 

Hi,

Please check the below picture and the attached pbix file.

it is for creating a new table.

 

Picture1.png

 

Output Table =
SELECTCOLUMNS ( Input, "Date", MIN ( Input[First Start], Input[Second Start] ) )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thanks that worked and thanks for showing me the min fucntion. I just tweaked it not to create a new table

MIN ( Input[First Start], Input[Second Start] ) )

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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