Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a table, through which it calculates Month's cover of Stock.
For this the user inputs the Number of Months as a variable and I have used what if parameter for this. So, if user enters 3 , it calculates sum of last 3 months of sales and divide current stock on hand by the sum of last 3 months sales to give Number of month's cover.
Now I need to create Pie chart of this depending on the Month's cover calculation. So if the answer is between 0-5 then pie chart slice is green, if month's cover is 6-10 then yellow and above that it should be red..
All my month's cover, sum of sales are measures. I can't get how to make a legend on pie chart based on 0-5,6-10 and greater that 10 for this.
@learner03 there are Paid custom visuals on Appsource that let you use measures as colours for Pie chart
Advanced Pie and Donut chart (Pie chart with full legend label)
https://appsource.microsoft.com/en-us/product/power-bi-visuals/piechartwithlegendlabelpro
1. Add the measure you want to use in 'Color by' box. (1st screenshot)
2. Click on the yellow color tray icon (top left), and use Format Style > Rules (2nd screenshot below)
Hi there,
Have you got the solution?
I am having the same issue
Thank you
Hi @learner03 ,
Here's a possible idea.
You can create a seperate table for the range.
Use the SWITCH function to judge the different results of fan'h.
Measure = SWITCH(MAX('Table (2)'[Legend]),"0-5",[Expression1],"6-10",[Expression2]))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous I used this approach from one of the videos and could create the chart, but there is a table underneath it which has details about items associated with customers. I also have slicers to select customers. The working should be when I click on a particular slice of pie chart, the data should be filtered or other ay around,when I click on particular slicer filter for customer the pie chart should change. This link is not happening as I do not have common column to connect.
I don't think you can use measures in the legend. But you can create a measure for each of the groups and add each measure to the Values section.
You need to create a column by clicking the 3 dots next to your table, choose "New column". You will see a window appears like when you create a new meausre. Put in: newcolumn = tablename[meausername]
Choose your pie char, drag the newcolumn to Legend and Values.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |