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

Chart to show count of users

Hi 

 

I was wondering if anyone could help me.

 

I have a SharePoint list with data.

splist-powerapps.png

NameEnrolled
JoeNo
JoeNo
JoeYes
RoyYes
RyanYes
RyanYes

 

In excel you can create a chart showing the users enrolled.

excel-powerapps.png

I would like to replate this in a powerapp using a Powerapp column chart, is that possible?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Chart to show count of users

@surfer1978 

You will need to perform a few actions on your SharePoint list to show it in the Chart similar to Excel

 

  • Filter the list by Enrolled=true
  • GroupBy Title
  • Count the number of rows

 

I would suggest doing this by creating a Collection.  Put this code in the OnVisible property of your screen.

 

//Group by and count code
ClearCollect(
    Filter(myChartData, Enrolled=true),
    DropColumns(
        AddColumns(
            GroupBy(ReportData,"Item","GroupedItems"),
        "Count Value",CountRows(GroupedItems)
        ),
    "GroupedItems"
    )
);

 

Now you can add a Bar Chart to your PowerApp and use this code in the Items property to display the data.

 

myChartData

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Chart to show count of users

@surfer1978 

You will need to perform a few actions on your SharePoint list to show it in the Chart similar to Excel

 

  • Filter the list by Enrolled=true
  • GroupBy Title
  • Count the number of rows

 

I would suggest doing this by creating a Collection.  Put this code in the OnVisible property of your screen.

 

//Group by and count code
ClearCollect(
    Filter(myChartData, Enrolled=true),
    DropColumns(
        AddColumns(
            GroupBy(ReportData,"Item","GroupedItems"),
        "Count Value",CountRows(GroupedItems)
        ),
    "GroupedItems"
    )
);

 

Now you can add a Bar Chart to your PowerApp and use this code in the Items property to display the data.

 

myChartData

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Super User
Super User

Re: Chart to show count of users

@surfer1978 

Please note: I have assumed that Enrolled is a Yes/No Column type in SharePoint.

surfer1978
Level: Powered On

Re: Chart to show count of users

Sorry it took so long to test but this worked. Thank you for provising the solution to that!

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,895)