Forum Discussion
Display a donut chart based on 2x2 matrix
- Anonymous4 years ago
You need to unpivot the two columns as attributed and then concatenate those attributes with each material:
Step 1: Unpivot Column Values:
You can do this by right clicking on Material and selecting "Unpivot Other Columns". This transforms the field headers into row values.
Step 2: Text Combine in M Power Query:
This is just a simple concatenation function which joins the materials with the unpivoted values for a new field header and set of values to use in the data visual below.
Step 3: Drop the Values into the Desired Chart:
However, since these data are so heavily skewed, certain slice results are quite obfuscated in this particular data visual; donut and pie charts are really only effective visuals when they have a small number of relatively unskewed data points. I'd probably consider a column or bar chart instead.
Hope this helps,
I'm not trying to move the labels to overlap the donut. I'm trying to have 4 values with 4 colours instead of the colours only being decided by the material. It's the legend that needs to change.
- Anonymous4 years agoNot applicable
Well, again, if you're trying to reference field headers as values in your data visual, you fundamentally need to unpivot your table's data columns: Installed and To Go so that they can be referenced as values in the data visual.
Once they're combined as new row values in an attribute column, you can drop them into the donut chart as multiple levels in the Legend. Only then will all four appear in the legend where you can apply the custom color palette for each data point. But you'll have to drill down first.
In my experience, I think your desired approach is generally bad practice, as donut charts don't render in published reports in Power BI very well (colors get mixed up, and the data values tend to be hard to read), and users often get confused or frustrated when having to drill up/down in a report to get the data they need.
Again, I'd with a column or bar chart instead.