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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.