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 / Filter nesting with da...
Power Apps
Unanswered

Filter nesting with date picker help

(0) ShareShare
ReportReport
Posted on by 69

Hi All,

 

I am having trouble with code to count rows based on nested filtering of my Collection table values within dates between two date picker values.

 

In the backend I have a SharePoint list which I have captured fully as a collection in my PowerApp. The collection is called 'AnalyticsCollection'

 

On my analytics screen I have a from date (DatePicker_Start), and a to date (DatePicker_End), and I have 2 drop down lists which values have been Set as variables. the lists include Region (varAnalyticsRegion) and Office (varAnalyticsOffice) - these values will match values in the Region and Office columns in the AnalyticsCollection.

 

I have a few variations of the filter (which will count rows based on the filter). if I can get this one right, I can then work out the rest.

 

This code should count rows where Created date is between the DatePicker values and where RegionLocated column is equal to the value of the region dropbox and where OfficeLocal column is equal to the value of the Office dropbox.

 

The formula is not providing the correct value, not sure why - please help.

 

snipesnab_0-1606833425343.png

 

 

CountRows(Filter(AnalyticsCollection,(Created >= DatePicker_Start.SelectedDate) && (Created <= DatePicker_End.SelectedDate) && RegionLocated = varAnalyticsRegion && OfficeLocal = varAnalyticsOffice))

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @snipesnab 

    Can you provide more detail on the RegionLocated and OfficeLocal column in your list?  If they are Choice columns you will need to alter your formula to the following:

    CountRows(
     Filter(AnalyticsCollection,
     (Created >= DatePicker_Start.SelectedDate) && 
     (Created <= DatePicker_End.SelectedDate) && 
     RegionLocated.Value = varAnalyticsRegion && 
     OfficeLocal.Value = varAnalyticsOffice
     )
    )

    Also, it appears the the Region and Office dropdown controls are already on your screen and showing the values, you can refer to that control in your formula rather than creating variables for them - in other words, the control is already your "variable".

     

    I hope this is helpful for you.

  • snipesnab Profile Picture
    69 on at

    Hi, the list columns are of type single line TEXT (both)

  • snipesnab Profile Picture
    69 on at

    Thanks for the feedback, I have tried your formatting but it does not like the '.Value' added:

    the list columns are of type single line TEXT (both)

     

    snipesnab_0-1606839167845.png

     

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 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard