cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
3csman
Impactful Individual
Impactful Individual

Date Condition Error After Change to Data Source

I had a Gallery that auto-populated fields based on a Dropdown. I changed my data sources and broke some formulas; two are shown below. 

 

There are two hidden fields (HiddenLookupDaystoRenewal and HiddenLookupComplianceStatus)

 

There error message I get reads: "Invalid Number of Arguements; Received 3; Expected 1-2.

 

If( LookUp( DaystoRenewalCollection, ClassTitles = ThisItem.CQTitle ).DaysToRenewal = 0, "Certified", DateDiff( DateValue(ThisItem.DteofCQ), Today(), Days ) > LookUp( DaystoRenewalCollection, ClassTitles=ThisItem.CQTitle ).DaysToRenewal || IsBlank(ThisItem.DteofCQ), "Noncompliant", "Compliant")

 

          There error message I get reads: "Invalid Number of Arguements; Received 3; Expected 1-2.

 

If( LookUp( DaystoRenewalCollection, ClassTitles = ThisItem.CQTitle ).DaysToRenewal = 0, "Certified", DateDiff( DateValue(ThisItem.DteofCQ), Today(), Days ) > LookUp( DaystoRenewalCollection, ClassTitles=ThisItem.CQTitle ).DaysToRenewal || IsBlank(ThisItem.DteofCQ), "Noncompliant", "Compliant")

 

        There error messages I get read: Invalid Argument Type (Date). Expecting a Text Value Instead.

                                                             The Function 'DateValue' has some Invalid Arguments. 

 

3csman_0-1601583420885.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User III
Super User III

@3csman ,

Assuming from the error message that DteofCQ is a date field, try this - I have also added some brackets which may fix the argument number error

If(
   LookUp( 
      DaystoRenewalCollection, 
      ClassTitles = ThisItem.CQTitle
   ).DaysToRenewal = 0, 
   "Certified", 
   (   
      DateDiff(
         ThisItem.DteofCQ, 
         Today(), 
         Days 
      ) > 
      LookUp( 
         DaystoRenewalCollection, 
         ClassTitles=ThisItem.CQTitle 
      ).DaysToRenewal 
   )|| 
   Value(ThisItem.DteofCQ)=0, 
   "Noncompliant", 
   "Compliant"
)

 

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.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User III
Super User III

@3csman ,

Assuming from the error message that DteofCQ is a date field, try this - I have also added some brackets which may fix the argument number error

If(
   LookUp( 
      DaystoRenewalCollection, 
      ClassTitles = ThisItem.CQTitle
   ).DaysToRenewal = 0, 
   "Certified", 
   (   
      DateDiff(
         ThisItem.DteofCQ, 
         Today(), 
         Days 
      ) > 
      LookUp( 
         DaystoRenewalCollection, 
         ClassTitles=ThisItem.CQTitle 
      ).DaysToRenewal 
   )|| 
   Value(ThisItem.DteofCQ)=0, 
   "Noncompliant", 
   "Compliant"
)

 

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.

View solution in original post

3csman
Impactful Individual
Impactful Individual

The 'Days to Renewal' should be a counter that displays the number of days until Member is Noncompliant. Its should be less one day everyday that clicks by.

 

As formatted with your suggested formula it displays the total number of days to in the compliance period (365).

 

I formula should work as a countdown. Everyday until the Days to Renewal is reached; at which point the Compliance Status would change from 'Compliant' to 'Noncompliant'.

 

This is what is currently in the Days to Renewal -

 

    "<sb>Days to Renewal: </b> <font color=blue>" &

    LookUp(DaystoRenewalCollection,ClassTitles=ThisItem.CQTitle).DaysToRenewal

 

3csman_0-1601606289425.png

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,363)