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
Anonymous
Not applicable

Min and max comparing to 2 columns

Hi Team,

I have 4 date columns I need to display min and max.

Min Date : I want to look if "actula start date" has date pick the min or if it is blank then look the value from "Planned Start Date".

Max Date : Similar as Min date but columns are "Planned Closed Date" &  "Actual Closed Date".

Here is my data. 

My out look is :

Min Date : 1/1/2020

Max Date : 1/6/2021

 

ProjectSub Project Planned Start DatePlanned Closed DateActual Start DateActual Closed Date
AAA1/12/20201/12/20211/2/2021 
AAB1/1/20201/6/20201/4/20201/10/2020
AAC1/6/20211/12/2021  
BBA1/5/20211/12/2021  
BBB1/4/20201/6/20201/6/20201/8/2021
BBC1/3/20211/5/20211/4/20211/6/2021

 

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Anonymous ,

 

you can do that with a measure like that:

Min Date = IF( MIN( 'Table'[Actual Start Date]) <> BLANK(), MIN( 'Table'[Actual Start Date] ), MIN( 'Table'[Planned Start Date] ) )

 

Similar then for the MAX.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

2 REPLIES 2
vanessafvg
Super User
Super User

you could do something like this

 

mindate =
IF (
    ISBLANK ( [actual start date] ),
    min([planned Start Date]),
    min([actual start date])
)

 

you can do similar for the max date





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




selimovd
Super User
Super User

Hey @Anonymous ,

 

you can do that with a measure like that:

Min Date = IF( MIN( 'Table'[Actual Start Date]) <> BLANK(), MIN( 'Table'[Actual Start Date] ), MIN( 'Table'[Planned Start Date] ) )

 

Similar then for the MAX.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

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.

Top Solution Authors