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 / Charts with filter, ha...
Power Apps
Answered

Charts with filter, having trouble with collection used while using a dropdown onchange property

(0) ShareShare
ReportReport
Posted on by 822 Moderator

Hello everyone,

My goal is to have a simple column chart that has filters.

I was able to do the first requirement which was to count all the Open and Closed status using this formulas below.

On the onchange property of my dropdown when its equals to All Requests.

 

 

If(
 //condition
 drpFilter_1.Selected.Category = "All Requests",
 //true---------------------------------------
 //Collect list via requeststatus
 ClearCollect(
 colRequestStatus,
 ForAll(
 Distinct(
 'Enquiries Improvement Request',
 RequestStatus.Value
 ),
 {Result: ThisRecord.Value}
 )
 );
 //Collect all request count
 ClearCollect(
 colRequestCount,
 AddColumns(
 colRequestStatus,
 "Count",
 CountRows(
 Filter(
 'Enquiries Improvement Request',
 RequestStatus.Value = colRequestStatus[@Result]
 )
 )
 )
 );Set(timerStart,true);,
 //false---------------------------------------

 
 Set(timerStart,true);
)

 

 

 items property of the chart:

colRequestCount



Now my problem is that I do not know what to do when other categories are selected in the dropdown. Ive tried several attempts to this however to no success I am stuck. I want to be able to present only the Open and Closed Request status of the selected category in the dropdown.


Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at

    Hi @kej ,

    Assuming Category is a Text column, try this

    ClearCollect(
     colRequestStatus,
     AddColumns(
     GroupBy(
     AddColumns(
     Filter(
     'Enquiries Improvement Request',
     drpFilter_1.Selected.Category = "All Requests" ||
     Category = drpFilter_1.Selected.Category
     ),
     "ReqVal",
     RequestStatus.Value
     ),
     "ReqVal",
     "Grouped"
     ),
     "Count",
     CountRows(Grouped)
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • KevinGador Profile Picture
    822 Moderator on at

    it worked! However when I change it the labels are also changed for example when all request.
    I also changed the name of the collection to colRequestCount since its the item property of my chart.

    kej_0-1711422882800.png

    but then when i change the dropdown

    kej_1-1711422911866.png

     



  • WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at

    Hi @kej ,

    I was focussed on getting your filter working, which seems to have worked.  You might have a look at which field you have in the Labels drop-down in Advanced in the right panel. I do not use charts much, so may not be a lot of help here.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • KevinGador Profile Picture
    822 Moderator on at

    no worries managed to get it working by renaming the column from ReqVal to Result

    kej_0-1711430442829.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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 88

#2
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 45

Last 30 days Overall leaderboard