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 / Charting mulitple seri...
Power Apps
Answered

Charting mulitple series with AddColumns, GroupBy, and CountRows

(0) ShareShare
ReportReport
Posted on by 8

I have a table with COVID information from my campus. My ultimate goal is to create a line chart with three series/lines charted over several days.

 

A button creates a collection (colChart) with two columns: open_file_date and reason_code (CASE, PROBABLE, and CONTACT), and filters the collection by a custom number of days. In the chart’s Items, I use AddColumns, GroupBy, Filter, and CountRows for one of the Reason Codes to get a count of the rows for each date with one Reason Code and get it to draw a series line. I would like three separate series/lines, one for each of the three possible Reason Codes so I need a count of all three possibilities in reason_code for each date.

 

 

Line Chart Items: AddColumns( GroupBy( Filter(colChart,reason_code="CASE"), "open_file_date","CASE_DATA"), "CaseCount", CountRows(CASE_DATA))

 

 

I know that AddColumns can add multiple columns to get PROBABLE and CONTACT’s counts, but can I do that in the above AddColumns statement, or is there another, better way? I've just about exhausted the YouTube videos on this one. Thanks!

Categories:
I have the same question (0)
  • Verified answer
    AaronKnox Profile Picture
    514 Super User 2024 Season 1 on at

    Hi, @CraigWilliams ,

    You were on the right track.  The solution is that AddColumns lets you keep adding columns, so don't stop at the CaseCount!  We also need to move the filter downstream, to evaluate the table GroupBy creates.

    AddColumns(GroupBy(colChart,"open_file_date","CASE_DATA"),
     "CaseCount",CountRows(Filter(CASE_DATA,reason_code="CASE")),
     "ProbableCount",CountRows(Filter(CASE_DATA,reason_code="PROBABLE")),
     "ContactCount",CountRows(Filter(CASE_DATA,reason_code="CONTACT"))
    )

     

    Capturef1.PNG

    Capturef2.PNG

  • CraigWilliams Profile Picture
    8 on at

    Perfect! Thanks for the extra nudge.

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard