Forum Discussion

ngarcia's avatar
ngarcia
Frequent Visitor
3 years ago
Solved

IF Function when date is empty (5 Columns)

 
Hi, 
 

I have 5 columns with different dates. I need a function that:

IF Column Date1 is empty, take Column Date2, and if this one is empty, take Column Date3 and if this one is empty, take Column Date4, and if this one is empty, take Column Date5.

 

 

I am currently using the below for 3 dates (3 columns) but am unsure how to change it to take into account the 5 dates.

= IF (Table 1[Del_Date_Promised_Original]= BLANK (),
IF ( Table 1[Del_Date_Promised_original_To] = BLANK (), Table 1[Back_order_Orig_Date_To], Table 1[Del_Date_Promised_original_To]),
Table 1[Del_Date_Promised_Original])

 

P.D: I used the above from another thread on here!

 

Thank you!!

  • ngarcia you can use COALESCE function

     

    COALESCE ( Table 1[Date1], Table 1[Date2], Table 1[Date3], Table 1[Date4], Table 1[Date5] )

     

    👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo

2 Replies

  • ngarcia you can use COALESCE function

     

    COALESCE ( Table 1[Date1], Table 1[Date2], Table 1[Date3], Table 1[Date4], Table 1[Date5] )

     

    👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo