Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
tina345
Helper II
Helper 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 unknown.

 

Data is like:

id, category

100,A

200,A

300,B

400,B

500,null

 

Could you please help?

2 ACCEPTED SOLUTIONS
DataZoe
Microsoft Employee
Microsoft 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)"
 
DataZoe_2-1623947120093.png

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

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

View solution in original post

2 REPLIES 2
DataZoe
Microsoft Employee
Microsoft 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)"
 
DataZoe_2-1623947120093.png

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors