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

Community site session details

Session Id : xi2LaqMh+8LQN9bMfoFuO2
Power Apps - Building Power Apps
Answered

DateDiff Function Error

Like (0) ShareShare
ReportReport
Posted on 2 Apr 2021 19:05:21 by 5,106 Super User 2025 Season 2

I am using the following condition in the Text property of a Gallery Label field.

 

When the Gallery fields are populated with data there is no error (in development view).

 

When there is no data in the Gallery fields the error (shown below) appears. 

 

     Gallery / DaystoRenewalFld / Text Property:

     Lookup(DaystoRenewalCollection,ClassTitles=ThisItem.CQTitle).DaystoRenewal - DateDiff((ThisItem.DteofCQ),Today(),Days)

 

     Power Apps Error Message:

     "The first argument to the DateDiff function cannot be blank."

Categories:
  • Phineas Profile Picture
    5,106 Super User 2025 Season 2 on 05 Apr 2021 at 14:36:52
    Re: DateDiff Function Error

    Sorry, just getting back to this; yes, your recommendation did clear the error message. Thank you.

  • WarrenBelz Profile Picture
    149,147 Most Valuable Professional on 04 Apr 2021 at 23:58:50
    Re: DateDiff Function Error

    Hi @Phineas ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    WarrenBelz Profile Picture
    149,147 Most Valuable Professional on 02 Apr 2021 at 20:49:40
    Re: DateDiff Function Error

    @Phineas ,

    That is because DatDiff() requires a date to be valid. Try this

    If(
     Value(ThisItem.DteofCQ)>0,
     Lookup(
     DaystoRenewalCollection,
     ClassTitles=ThisItem.CQTitle
     ).DaystoRenewal - 
     DateDiff(
     ThisItem.DteofCQ,
     Today(),
     Days
     ),
     0
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete