cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Applications
Helper IV
Helper IV

Cant Add Two Filtered Values

Good morning all!

 

I'm trying to have a formula calculate two selected values from a PowerApp that populates a SharePoint list: Primary Date and Alternate Date.

Applications_0-1663856304157.png

Here is my current formula:

"Number of Participants Currently Enrolled For Your Selected Date: " & 
With({_items: Filter('North Campus Walking Tour Signup Tracker', 'Primary Date'.Value = DataCardValue4.Selected.Value)},
CountRows(_items))

It works well for the Primary Date, but for the alternate date, I can't get it to calculate correctly:

Number of Participants Currently Enrolled For Your Selected Date: " & 
With({_items: Filter('North Campus Walking Tour Signup Tracker', 'Alternate Date'.Value = DataCardValue4.Selected.Value)},
CountRows(_items)) 

 

I get the following error:

Applications_1-1663856524843.png

 

Lastly, I'm building an "admin view" for people that sign up, but since I can't get the Alternate Date to calculate correctly, the formula doesn't show the correct number:

Sum(
With({_items: Filter('North Campus Walking Tour Signup Tracker', 'Primary Date'.Value = "1 September")},
CountRows(_items))
&&
With({_items: Filter('North Campus Walking Tour Signup Tracker', 'Alternate Date'.Value = "1 September")},
CountRows(_items))
)

 The error for this formula is:

Applications_2-1663856641515.png

 

 

Any thoughts on how to correct the formulas? Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Applications 

If it is single select now, then your formula should work properly.

Is it??

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@Applications 

In your formula you are specifying a table to compare to...that will not work.

If your 'Alternate Date' column is a date column, then your formula should be:

Number of Participants Currently Enrolled For Your Selected Date: " & 
  With({_items: Filter('North Campus Walking Tour Signup Tracker', 'Alternate Date' = 
     DataCardValue4.Selected.Value)}, 
     CountRows(_items)
  ) 

However, the above is true if that column is a date column.  I have a feeling that perhaps it is a Choice column in your list...please clarify.

 

If it is a choice column, then you most likely have that column defined to allow multiple values.  Please clarify as well.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Correct, both the Primary and Alternate Date columns are choice columns, rather than Date columns.

RandyHayes
Super User
Super User

@Applications 

That is fine, but the more important part was the second thing for you to clarify - "then you most likely have that column defined to allow multiple values. Please clarify as well." 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Ahh, apologies. The Alternate Date was a multiple selection column, yes - but I recreated it and it's now a single-selection column

RandyHayes
Super User
Super User

@Applications 

If it is single select now, then your formula should work properly.

Is it??

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Applications
Helper IV
Helper IV

It is, yes! I just cant mark as "Accept as Solution" because my work computer isn't letting me haha. But thank you so much! I'll mark it complete later 🙂

RandyHayes
Super User
Super User

@Applications 

No worries...just wanted to make sure you were good now.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,508)