web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Compare two dates

(0) ShareShare
ReportReport
Posted on by 404

Hello.

Help me please to create calculated column. 

I need to compare two dates: Desired date and Date Completed. 

The result must be "Yes" If Desired date is later than date completed or "No" If it is earlier.

I made like this, but there is an error "Sorry, something went wrong"

Annotation 2020-05-29 190453.png

 

 
Categories:
I have the same question (0)
  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    Hi @ppl ,

     

    Try this,

    IF([Date Completed]>[Desired Date];"No";"Yes")

    See this article for more information:
    https://sharepoint.stackexchange.com/questions/245533/calculated-column-comparing-two-dates

     

    I hope this resolved your issue if you see any challenge let me know I am always happy to help.

     

    Regards,

    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • ppl Profile Picture
    404 on at

    @KrishnaV 

    Same problem. I've tried both "," and ";"

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @ppl ,

     

    Could you please share the detailed error message?

    What is the data type of Date Completed and Desired Date columns?

     

    I just made a test on my side following your formula based on two Date Columns, but the formula works properly.

    Could you please try to set the data type to single line of text to see if the issue is fixed?

    If not, please consider creating a new sharepoint list and try again.

    Hope this helps.

    Sik

  • KrishnaV Profile Picture
    5,023 on at

    Hi @ppl ,

     

    Sincere apologies on the silly syntax error 😥 see the below working code:

     

    =IF([Date Completed]>[Desired Date],"yes","No")

     

    Caliculated Column.png

    once again sorry for the miss.

     

    I hope this resolved your issue if you see any challenge/need further help let me know I am always happy to help.

     

    Regards,
    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • ppl Profile Picture
    404 on at

    @KrishnaV 

    @v-siky-msft 

    I don't understand what I do wrong?

    {FA38079A-ECE6-4F4C-879B-24382A16B812}.png.jpg{C8461049-82C7-4F82-8A3E-CD7E3ED75E03}.png.jpg

     

    Also I've tried to choose returned data type - single line or text. Same error.

  • KrishnaV Profile Picture
    5,023 on at

    Hi @ppl,

     

    Try like this as I do in this walkthrough:
    DateCompare in Cal Column.gif

     

    Note: Ignore if you see any error while you are building the formula this should work for you.

    I hope this resolved your issue if you see any challenge/need further help let me know I am always happy to help.

     

    Regards,
    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • ppl Profile Picture
    404 on at

    @KrishnaV 

    2.gif

  • KrishnaV Profile Picture
    5,023 on at

    Hi @ppl,

     

    I have created the columns with the same names (Date Completed,Due Date and KPI) but I don't see any issue, is it possible to delete and recreate the calculated column alone? I sure you might have tried it already but for my sake could you do it one more time of recreating the calculated column?

    DateCompare in Cal col.png

    If you see any challenge/need further help let me know I am always happy to help.

     

    Regards,
    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @ppl ,

     

    That's weird, your formula is perfectly valid.

    What is your Language Setting of the Sharepoint site? If it is a non-english site, you should use the localized version of function names and ";" instead of commas.

    Hope this helps.

    Sik

     

  • KrishnaV Profile Picture
    5,023 on at

    Hi @ppl ,

     

    I just want to follow up with you to see is this issue resolved or not.

     

    If you see any challenge/need further help let me know I am always happy to help.

     

    Regards,
    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard