Forum Discussion
neenu
3 years agoRegular Visitor
Compare two date colums
Hi I have 2 date columns. I need to find out which date is greater than other.please suggest a solution
edhans
3 years agoCommunity Champion
If you want to do this in Power Query, there are several ways. If you want to know which is larger:
if [Date1] > [Date2] then "Date 1" else "Date 2"
If you just want to return the largest date, then
List.Max({[Date1], [Date2]})
The {} brackets put the Date1 and Date2 field in a list and returns the largest.
In DAX, it is similar:
IF(
Table[Date1] > Table[Date2],
"Date 1",
"Date 2"
)
Or just returning the largest:
MAX(Table[Date1],Table[Date2])
You could substitute measures for those table[date] fields depending on what your report is doing.