Forum Discussion
tina345
5 years agoHelper II
Pie Chart with distinct column value
Hello All, I am new to power BI and trying to create a simple PI chart. I am trying to create a Pie Chart between ID and Distinct Category.Some category are nulls and would like to represent as unk...
- 5 years ago
Hi tina345 ,
You can try these steps:
1. Create a column to reclassify the null to Unknown, by right-clicking the Table and choosing "New column" and using this DAX expression:
New Category = if(len([Category])=0,"Unknown",[Category])which simply says if it's blank (or null) then have it be Unknown, otherwise use the category.2. Add a pie chart to the page3. Add the "New Category" to the Legend and the "ID" to the Values section.4. The IDs might try to sum instead of doing a count, so to change that, click the drop down next to ID and choose "Count (Distinct)" - 5 years ago
Thanks DataZoe ..I was able to create a chart.
DataZoe
5 years agoMicrosoft Employee
Hi tina345 ,
You can try these steps:
1. Create a column to reclassify the null to Unknown, by right-clicking the Table and choosing "New column" and using this DAX expression:
New Category = if(len([Category])=0,"Unknown",[Category])
which simply says if it's blank (or null) then have it be Unknown, otherwise use the category.
2. Add a pie chart to the page
3. Add the "New Category" to the Legend and the "ID" to the Values section.
4. The IDs might try to sum instead of doing a count, so to change that, click the drop down next to ID and choose "Count (Distinct)"
- tina3455 years agoHelper II
Thanks DataZoe ..I was able to create a chart.