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:
Active 10
Waiting Approval 5
Complete 6
Not Accepted 3
Thanks in advance.
Solved! Go to Solution.
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?
@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))
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:
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
@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.
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
)
)
)
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!
@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
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
196 | |
69 | |
49 | |
46 | |
18 |
User | Count |
---|---|
249 | |
126 | |
84 | |
75 | |
74 |