Forum Discussion

Centaur1's avatar
Centaur1
Regular Visitor
1 year ago
Solved

Compare 2 date fields and use Greater than date

Hello,   I am a novice user of PQ.  I need to compare 2 dates I have: Date1 and Date2 If Date2>=Date1 then use Date2 else use Date1 I added a conditional column but I think the issue is that I ...
  • BeaBF's avatar
    1 year ago

    Centaur1 Try:

    = Table.AddColumn(
    #"Reordered Columns",
    "Custom",
    each
    if [Date2] = null then [Date1]
    else if [Date2] >= [Date1] then [Date2]
    else [Date1]
    )

     

    BBF