Forum Discussion

shubhamamilkant's avatar
6 years ago
Solved

Compare Dates and Find minimum in table

I have a table with 3 Columns (date datatype) and I need to create new column, which will give me minimum of these 3 column (smallest date)

I can use if else for 2 comparing columns, Is there is a function which i can used to compare the dates with more than 2 columns instead of if-else .

 

ex - 

Col A - 10/1/2020

Col B - 7/1/2020

Col C - 8/1/2020

Result column - 7/1/2020

Thanks in Advance,

 

Shubham

  • This is the answer i used to find min date 
    SLA Tracker is table name,
    COL A, COL B, COL C are 3 different columns with Date data type

    IF('sla tracker'[Col A]=BLANK(),COALESCE('sla tracker'[COL B],'sla tracker'[COL C]),
    IF('sla tracker'[COL B]=BLANK(),COALESCE('sla tracker'[COL A],'sla tracker'[COL C]),
    IF('sla tracker'[COL C] = BLANK(),COALESCE('sla tracker'[COL A],'sla tracker'[COL B]),
    MIN(MIN('sla tracker'[COL A],'sla tracker'[COL B]),'sla tracker'[COL C]))))

3 Replies

  • v-diye-msft's avatar
    v-diye-msft
    Icon for Community Support rankCommunity Support

    Hi shubhamamilkant 

     

    You might consider providing your dummy pbix that would be helpful for us to investigate it further. 

    You can upload it to the onedrive for business and share the link here. please don't forget to disclose the expected results and remove the confidential info.

     

  • This is the answer i used to find min date 
    SLA Tracker is table name,
    COL A, COL B, COL C are 3 different columns with Date data type

    IF('sla tracker'[Col A]=BLANK(),COALESCE('sla tracker'[COL B],'sla tracker'[COL C]),
    IF('sla tracker'[COL B]=BLANK(),COALESCE('sla tracker'[COL A],'sla tracker'[COL C]),
    IF('sla tracker'[COL C] = BLANK(),COALESCE('sla tracker'[COL A],'sla tracker'[COL B]),
    MIN(MIN('sla tracker'[COL A],'sla tracker'[COL B]),'sla tracker'[COL C]))))