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 Platform Community / Forums / Power Apps / DateDiff using Date Pi...
Power Apps
Unanswered

DateDiff using Date Pickers suddenly not working (Invalid argument type error)

(0) ShareShare
ReportReport
Posted on by 43

I have a field in which DateDiff is used to calculate the difference between two date pickers to alter the visibility of other fields. It was working just fine until this morning. 

 

I am now getting the 'Incorrect argument type, expecting number' error.

 

The DateDiff formulas in question is:

DateDiff(DateValue1.SelectedDate, DateValue2.SelectedDate, Days)+1

 

I would really appreciate if someone could help me solve this problem.

 

Categories:
  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    I just tested that exact scenario and its working fine for me.  What is the full formula you are using to control the visibility?

  • KC-09091536-0 Profile Picture
    43 on at

    The exact formula is:

    If((DateDiff(DataCardValue57.SelectedDate, DataCardValue58.SelectedDate, Days) + 1) >= 5, true, false)

    The objective is to make the field visible if the difference between the dates is 5 or more days.

  • Pstork1 Profile Picture
    69,661 Most Valuable Professional on at

    The logic is fine as long as both of the Data Cards are pointed at Time/Date fields.  The only other issue is that the DataCardValues could be null if a Date hasn't actually been selected in the field.  

  • KC-09091536-0 Profile Picture
    43 on at

    I ended up formatting the Selected Dates as numbers and just subtracting them instead of using the DateDiff as this was a prod error and needed to be solved quickly. Thank you for your time.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard