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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,194)