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
andrewb95
Helper II
Helper II

min on dates row by row

I have some data with activities for two events. For the purpose of the explanaiton date 1 and date 2.  A user can complete either date 1 or date 2 or both. I want to populate the third column with the first date of these two actions. 

 

As you can see when a user has completed both using the following:   Min= MIN(Data.[Date1].[Date],Data[Date2].[Date])

 

However the issue is when one of the objects only has one value the min column does not populate... 

 

Example data set:

Date1Date2Min
01/02/2020 01/02/2020
02/02/202005/02/202002/02/2020
 08/02/202008/02/2020

 

Objects with a strikethrough currently don't appear due to blanks in other column. I need to be able to see the items with the strikethrough too. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@andrewb95 , Try without .date

 

Or try like

Switch(true(),
not(isblank(Data[Date1])) && not(isblank(Data[Date2])), min(Data[Date1],Data[Date2]),
isblank(Data[Date1]) ,Data[Date2]
isblank(Data[Date2]),Data[Date1])

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@andrewb95 , Try without .date

 

Or try like

Switch(true(),
not(isblank(Data[Date1])) && not(isblank(Data[Date2])), min(Data[Date1],Data[Date2]),
isblank(Data[Date1]) ,Data[Date2]
isblank(Data[Date2]),Data[Date1])

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.