web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help Grouping and coun...
Power Apps
Suggested Answer

Help Grouping and counting data for PowerApps Chart

(1) ShareShare
ReportReport
Posted on by
Hello,
 
I am trying to build a column chart that includes a field with ~5 category choices and then as part of that separates it out by status (open or closed). Essentially, I'd like it to look like the below image. 



I am struggling to get GroupBy and AddColumns function to work correctly and am unable to have the "Open" status appear correctly next to the total count by step. I'm pasting both the Item code and image below. Any thoughts?

Item Formula: 
AddColumns(GroupBy(AddColumns('[TEST Intake]',DecisionName,'Current Decision Step',StatusOpen,Status = "Open"),DecisionName,StatusOpen,Grp_Decision),DecisionCount,CountRows(ThisRecord.Grp_Decision))

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,523 Most Valuable Professional on at
    I will try a HI (Human Intelligence) response instead of the copy and paste from ChatGPT from the last one. I am not entirely sure what your exact expected outcome is, but if you want to add the number of open Status items per group
    AddColumns(
       GroupBy(
          AddColumns(
             '[TEST Intake]',
             DecisionName,
             'Current Decision Step',
             StatusOpen,
             Status = "Open"
          ),
          DecisionName,
          StatusOpen,
          Grp_Decision
       ),
       DecisionCount,
       CountRows(Grp_Decision)
       OpenCount,
       CountRows(
          Filter(
             Grp_Decision,
             StatusOpen
          )
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • Suggested answer
    Ravi-Prajapati Profile Picture
    416 Super User 2025 Season 2 on at

    It looks like you're trying to create a grouped column chart in Power Apps where:

    1. Categories are represented by DecisionName.
    2. Each category is further divided into StatusOpen (either "Open" or "Closed").
    3. The chart should show counts of each combination.

    Your current formula has a few issues:

    • StatusOpen, Status = "Open": This assigns a boolean (true/false) instead of "Open" or "Closed".
    • The GroupBy() is grouping by both DecisionName and StatusOpen, but then Grp_Decision might not correctly separate the counts.

    Suggested Fix:

    Try this formula instead:

     
    AddColumns(
    GroupBy(
    AddColumns(
    '[TEST Intake]',
    "StatusLabel", If(Status = "Open", "Open", "Closed") // Ensuring a proper text value
    ),
    "DecisionName", "StatusLabel", "Grp_Decision"
    ),
    "DecisionCount", CountRows(Grp_Decision)
    )

    Explanation of Fixes:

    1. Ensuring Status Label is Proper Text:

      • AddColumns('[TEST Intake]', "StatusLabel", If(Status = "Open", "Open", "Closed"))
      • This creates a new column "StatusLabel" containing "Open" or "Closed" instead of true/false.
    2. Grouping Correctly:

      • GroupBy(..., "DecisionName", "StatusLabel", "Grp_Decision")
      • Groups by DecisionName (main category) and "StatusLabel" (subgroup).
    3. Counting Correctly:

      • AddColumns(..., "DecisionCount", CountRows(Grp_Decision))
      • Counts how many records are in each (DecisionName, StatusLabel) group.

    Expected Output Format:

    This should return a table where:

    DecisionName StatusLabel DecisionCount
    Step A Open 10
    Step A Closed 5
    Step B Open 8
    Step B Closed 12

    Now, when used in a column chart, it should display stacked columns where each DecisionName has separate "Open" and "Closed" bars.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 421

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard