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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors