cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
solidus
Frequent Visitor

Using charts show distribution of values in a column

Hi,

 

I'm have a table with some columns which are numerical values. I would like to use the charts functionality to show the distribution of these values. I tried creating a new table in the underlying excel spreadsheet but I got an error saying that spreadsheet formula are not yet supported.

 

Is there a way inside PowerApps to plot this easily.

 

At the moment my data looks like

 

Risks.Severity

Between 0 and 10. And I would like, for example to plot the data below (where the 2nd column is the number if Risks with severity 0, 1, 2 etc.).

 

0    0

1    3

2    6

3    9

4    2

5    1

6    0

7    0

8    0

9    1

10  1

 

Cheers

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

You can use the GroupBy function to aggregate the data. In your case, if you have a data source with a Severity column, and you want to aggregate on the number of issues with each severity (like in the table below):

ClearCollect(Risks,
    {Severity: 1, Name: "Issue 01"},
    {Severity: 1, Name: "Issue 02"},
    {Severity: 1, Name: "Issue 03"},
    {Severity: 2, Name: "Issue 04"},
    {Severity: 2, Name: "Issue 05"},
    {Severity: 2, Name: "Issue 06"},
    {Severity: 2, Name: "Issue 07"},
    {Severity: 2, Name: "Issue 08"},
    {Severity: 2, Name: "Issue 09"},
    {Severity: 3, Name: "Issue 10"},
    {Severity: 3, Name: "Issue 11"},
    {Severity: 3, Name: "Issue 12"}, ...
 )

Then you can insert a new chart control, and in its Items property, you can group the Risks table by the severity, and add a new column to the group that uses the CountRows function to find out how many issues with a given severity exist:

AddColumns(GroupBy(Risks, "Severity", "BySeverity"), "Count", CountRows(BySeverity))

For example this is the rendering of a bar chart (histogram) for the data that you showed:

ForumPost001.PNG

Notice that you may also need to define which of the columns are to be used in the X and Y axis, which you can do in the Advanced view when selecting the chart:

ForumPost002.PNG

Other chart types (such as a pie chart) would also work the same way.

 

Hope this helps!

View solution in original post

2 REPLIES 2
CarlosFigueira
Power Apps
Power Apps

You can use the GroupBy function to aggregate the data. In your case, if you have a data source with a Severity column, and you want to aggregate on the number of issues with each severity (like in the table below):

ClearCollect(Risks,
    {Severity: 1, Name: "Issue 01"},
    {Severity: 1, Name: "Issue 02"},
    {Severity: 1, Name: "Issue 03"},
    {Severity: 2, Name: "Issue 04"},
    {Severity: 2, Name: "Issue 05"},
    {Severity: 2, Name: "Issue 06"},
    {Severity: 2, Name: "Issue 07"},
    {Severity: 2, Name: "Issue 08"},
    {Severity: 2, Name: "Issue 09"},
    {Severity: 3, Name: "Issue 10"},
    {Severity: 3, Name: "Issue 11"},
    {Severity: 3, Name: "Issue 12"}, ...
 )

Then you can insert a new chart control, and in its Items property, you can group the Risks table by the severity, and add a new column to the group that uses the CountRows function to find out how many issues with a given severity exist:

AddColumns(GroupBy(Risks, "Severity", "BySeverity"), "Count", CountRows(BySeverity))

For example this is the rendering of a bar chart (histogram) for the data that you showed:

ForumPost001.PNG

Notice that you may also need to define which of the columns are to be used in the X and Y axis, which you can do in the Advanced view when selecting the chart:

ForumPost002.PNG

Other chart types (such as a pie chart) would also work the same way.

 

Hope this helps!

View solution in original post

How would you go about filtering the data as well

I've tried using Filter to what you wrote, but I get an "Invalid Argument Type" error

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,299)