cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShadowTech
Post Partisan
Post Partisan

Dropdown menu for pie chart

Hello,

 

Looking to create a pie chart with a dropdown menu that users can see different data in the pie chart based on the dropdown menu selections which include by "current year" and "current month" of the column called "Status". The column  is a "Choice" SharePoint column. In addition to the SharePoint column I need to see the total count of each value.

 

Example below:

 

pie.jpg

 

 

Active 10
Waiting Approval 5
Complete 6
Not Accepted 3

 

 

 

 

 

dropdown.jpg

 

 

 

Thanks in advance.

33 REPLIES 33

@RandyHayes dcdPieData.Update.PieData.Legend

RandyHayes
Super User III
Super User III

@ShadowTech 

That is the correct formula.  

And you DO have this line still in your Update property on the datacard:

Legend: Coalesce(_status, "Blank") & " " & CountRows(Filter(records, Status.Value=_status)

 

Your screen shot is a relatively isolated snippet.  It looks like the legend is underneath of something else on the screen.  Can you provide a more broad screenshot?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes I have another pie chart I was testing out on the screen. That's why it looks like that. But all you see is the colored dots and no text.

 

Legend: Coalesce(_status, "Blank") & " " & CountRows(Filter(records, Status.Value=_status))

 

 

RandyHayes
Super User III
Super User III

@ShadowTech 

I'm a bit confused then.  I have now the same setup as you with the exception that my choice column is different and that I have some additional ranges in my dropdown (because the list I used has older entries then current year and current month).

Here is what I see:

RandyHayes_0-1609882985049.png

And that is using the exact same formulas...

 

There are two things I would try:

1) for the Items property of the Legend, select the entire formula and then cut it.  Then paste it back in.  Both the Pie and the Legend have issues sometimes with their formulas being changed.

 

2) Put a Gallery on the screen and set the Items property to dcdPieData.Update.PieData.Legend

    Put a label in the Gallery and set to ThisItem.Legend

    Make sure you are seeing the proper values

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes That did it! Awesome! Thanks so much for your help Randy.

 

Quick question: If I have a label that I want to count all new records for the current day, would I use the following? As this for some reason is only showing "0". I doing based on "Created".

 

CountRows(
Filter('Credit Memo', Created = Today())
)

 

Thanks again.

View solution in original post

RandyHayes
Super User III
Super User III

@ShadowTech 

Yes, in general that is what you want, however, two things:

1) Be aware that CountRows is not delegable and you might see warnings for it.  However, the Filter should resolve that.

2) Created is a Date and a Time.  So trying to Filter by just Today() will never match any record (unless there happens to be a record created at exactly 0:00 on that day) as Today will not have any time information.

 

So, to battle #2, you can change your formula to the following:

CountRows(
    Filter('Credit Memo', Text(Created, ShortDate) = Text(Today(), ShortDate))
)

This will definitely not delegate!  It's a delegation battle all the time, but this works - filter by created equal to or greater than today and less than tomorrow: 

CountRows(
    With({_tomorrow: DateAdd(Today(), 1, Days)},
        Filter('Credit Memo', 
            Created >= Today() && Created < _tomorrow
        )
    )​
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes Awesome. Thanks again!

RandyHayes
Super User III
Super User III

@ShadowTech 

No problem. If you wouldn't mind, please review back over our thread of messages and mark one of the posts from me that helped resolve your issue the most as a solution.  Thanks!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes Randy, any idea why another PieChart done the same exact way just the canvas data card and formula change a bit to point to another "Choice" column has the pie chart show numbers next to the text? The first pie chart shows correctly but the second one adds the number count as well as in the legend.

 

Thanks

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,212)