Forum Discussion
Create pie chart based on measure
- 1 year ago
Power BI (unlike Tableau) does not support dynamic bucketing. You need to bring your own buckets, in a disconnected table - like you did in the "Notice" table. You can then base your
horriblepie chart on that table.
you need to group first before you can apply the measure filter. Otherwise it would attempt to filter the individual rows.
One more question:
How can I create a pie chart that shows the count for each notice type?
I want the pie chart to show:
- Number of Sales Notices
- Number of Refund Notices
Do I need to create a separate measure for each notice type?
- lbendlin1 year agoSuper User
You can change your buckets to represent notice types. (Sales or Refund) Then adjust your measure accordingly
Are you sure a pie chart is the right chart for the data story you are trying to tell?
- cheryl03161 year agoHelper II
Yes I know that's a bit weird
I want to create a pie chart in PowerBI to show the distribution of each notice type. This is an example created in Excel
I want to calculate the number of each notice type based on each country, city, employee, and product category.
The number of highlighted cells is same as the values shown for each notice type in the pie chart above
My current thought:
1. Create a new table with a column called "Notice Type," which will be used as the Legend in the pie chart.
2. Create a measure
NoticeTypeCount =VAR Sales_Notice = IF([Sum_Sales Amount] < 100, 1, 0)VAR Refund_Notice = IF([Sum_Refund Amount] > 10, 1, 0)VAR a = SUMMARIZECOLUMNS(dimLocation[Country],dimLocation[City],dimEmployee[Employee Name],dimProduct[Product Category])VAR b = ADDCOLUMNS(a, "Sales notice", Sales_Notice, "Refund notice", Refund_Notice, "Revenue amount", [Sum_Sales Amount])return countrows(filter(b,[Revenue amount]>0))I think var b is wrong because "Sales notice" and "Refund notice" should be grouped under a column (?)I’m a bit confused when it comes to summarizing tables or columns. Any advice would be appreciated. Thank you for your help!