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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Compare 2 Date Columns by Time Logic

I have two date related formulas that I am requested help with.

 

1. I have 2 different date columns ([Date Completed] and [Store Date]) which I'd like to compare. I want to build logic so that I can compile a list of all the rows where [Date Completed] was AFTER [Store Date]. 

 

2. I would like to compare if a date column [Date Approved] is within 2 weeks (14 days) of [Date Reviewed]

 

Thank you!

1 ACCEPTED SOLUTION

Hi @Anonymous,

From your description, I have entered some sample data like the picture below:

For the first issue:

Sample data

1.PNG

Create a calculated column and you can see the result.

Column = IF([Date Completed]>=[Store Date],[Date Completed],BLANK())

2.PNG

For the second issue:

Sample data

3.PNG

Create a calculated column and you can see the result.

Column = (DATEDIFF([Date Approved],[Date Reviewed],WEEK)+1)<=2

4.PNG

If I misunderstood you, could you please offer me more information about your data structure or share your pbix file if possible?

 

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/q0uw1ndwbfmkt40/Compare%202%20Date%20Columns%20by%20Time%20Logic.pbix?dl=0

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Could you please tell me the [Date Completed] column and [Store Date] column are in one table or in different tables? And the list you want to compile is a column in date view or a list in query editor? And I could not get any data information about the [Date Approved] column and [Date Reviewed] column. Could you please offer me more information about your data structure and post me your desired picture?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

hi @v-danhe-msft

 

Both [Date Completed] and [Store Date] are in the same table. The list or measure I want to make would be a calculated column ideally, which would say something like True/False if [Date Approved] is within 2 weeks of [Date Reviewed], then I could do a count DAX to add those up and put that into a chart or to list out in a summary all the projects that are within 2 weeks. 

I hope that helps

Hi @Anonymous,

From your description, I have entered some sample data like the picture below:

For the first issue:

Sample data

1.PNG

Create a calculated column and you can see the result.

Column = IF([Date Completed]>=[Store Date],[Date Completed],BLANK())

2.PNG

For the second issue:

Sample data

3.PNG

Create a calculated column and you can see the result.

Column = (DATEDIFF([Date Approved],[Date Reviewed],WEEK)+1)<=2

4.PNG

If I misunderstood you, could you please offer me more information about your data structure or share your pbix file if possible?

 

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/q0uw1ndwbfmkt40/Compare%202%20Date%20Columns%20by%20Time%20Logic.pbix?dl=0

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi what can be done if I want it to display as "On Time/Late" instead of True False?

you could run a secondary column that runs a simple IF/THEN in which true=on time, and false=Late. 

 

Or Nest the if statement at the front

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors