Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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?
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 172 | |
| 107 | |
| 92 | |
| 54 | |
| 46 |