cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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

@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

@surfer1978 

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

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

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (58,676)