Forum Discussion
pie chart based on count
I have these two columns in the report- I want Pie chart based on count of the rows of months column where months value is between 1-2 then3 and 6,6-10 and rest more than 10. And showing sum of dollar value in the pie chart in their respective region.
| Cost | Months |
| $481,948 | 8 |
| $399,263 | 25 |
| $295,784 | 36 |
| $229,014 | 25 |
| $191,070 | 8 |
| $188,109 | 8 |
| $147,928 | 4 |
| $136,728 | 2 |
| $106,519 | 5 |
| $102,782 | 10 |
| $77,583 | 5 |
| $92,820 | 7 |
| $82,212 | 6 |
| $76,248 | 9 |
| $68,529 | 3 |
| $71,543 | 34 |
| $53,061 | 4 |
| $49,058 | 6 |
| $25,054 | 42 |
| $19,115 | 12 |
| $20,128 | 2 |
| $21,550 | 20 |
5 Replies
- amitchandakSuper User
learner03 , are you looking for count bucketing?
Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626
Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k- learner03Post Partisan
- v-jingzhangCommunity Support
Hi learner03
You can add a calculated column with below DAX in the original table, then use it to create a pie chart like below. Is this what you want? "Sum of Cost" will display in the pop-up tooltip once the mouse cursor hovers over a sector.
Month Group = SWITCH(TRUE(), 'Table'[Months]<=2, "1-2", 'Table'[Months]<=6, "3-6", 'Table'[Months]<=10, "7-10", "> 10" )Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.- learner03Post Partisan
Hi v-jingzhang Can I do this in some way using a measure because my stock cover and Cost is a measure and not a direct column in the table?
- v-jingzhangCommunity Support
Hi learner03
I'm not sure without knowing how the data is like. Can you provide some sample data in table format and the DAX formula of those measures? And which fields do you want to place into the pie chart?
BR,
Jing