cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
solidus
Level: Powered On

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
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Using charts show distribution of values in a column

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
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Using charts show distribution of values in a column

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

Chicko29
Level: Powered On

Re: Using charts show distribution of values in a column

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,433)