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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Yutong
New Member

Why when the value of a pie chart is blank, the pie chart still show something?

I want to show a dynamic chart according to how many years were chosen in a slicer. When 1 years was selected, the pie chart would show, otherwise the pie chart would show nothing. So I create a measure as the value of the pie chart.

 

stay number= if(COUNTROWS(VALUES(table1[years])=1,DISTINCTCOUNT(table1[Stay Number]),BLANK()).

The problem is that the pie chart still show some data when this measure return BLANK().  I am so confused cause when I let stay number directly equals BLANK(), the pie chart works correctly. I wonder if there's sth wrong with this DAX, but I've checked the DAX indeed return BLANK() when I selected 2 years.

 

I also try another measure:

stay number = if(ISFILTERED(table1[years]),DISTINCTCOUNT(table1[Stay Number]),BLANK()).

The pie chart with this measure works correctly all the time. But it does not satisfy my requirement: only show when 1 fiscal year was selected.

 

How can I solve it?

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @Yutong 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.