cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
Super User III
Super User III

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
Highlighted
Super User III
Super User III

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

Highlighted
Super User III
Super User III

Re: Chart to show count of users

@surfer1978 

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

Highlighted
Helper I
Helper I

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (8,384)