Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
neenu
Regular 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

4 REPLIES 4
edhans
Community Champion
Community 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. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Manoj_Nair
Solution Supplier
Solution Supplier

@neenu- Check this out, let me know if this works.

Date Measure = 
VAR Date1 = MAX('Table'[Date Column 1])
VAR Date2 = MAX('Table'[Date Column 2])
RETURN
IF(Date1 > Date2, "Date Column 1", "Date Column 2")

Just chirping in here, you can actually return the dates using the varia

Date Measure = 
VAR Date1 = MAX('Table'[Date Column 1])
VAR Date2 = MAX('Table'[Date Column 2])
RETURN
IF(Date1 > Date2, Date1, Date2)

ble, see:





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





ray_aramburo
Super User
Super User

You have 2 options, both simple:

1) Create a calculated column with DAX in Power BI Desktop: DateEvaluation = IF(Table[Date1] > Table[Date2], "Greater", "Not Greater")

2) In Power Query create a Conditional column with the same logic using the UI for conditional columns. 





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.