Forum Discussion

tina345's avatar
tina345
Helper II
5 years ago
Solved

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...
  • DataZoe's avatar
    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 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)"
     

     

  • tina345's avatar
    tina345
    5 years ago

    Thanks DataZoe ..I was able to create a chart.