Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I have a pie chart filtered to show only XYZ items for the past 1 calendar months. The chart doesnt show any values since theres no XYZ items for December 2024. I want the chart to automatically show 0 if theres no data. Sample data set and screenshot below. Thank you in advace
powerbi screenshot
data set:
Category | Date |
ABC | 12/8/2024 |
ABC | 12/9/2024 |
ABC | 12/10/2024 |
ABC | 12/11/2024 |
ABC | 12/12/2024 |
XYZ | 11/13/2024 |
XYZ | 11/14/2024 |
DEF | 12/12/2024 |
DEF | 12/13/2024 |
DEF | 12/14/2024 |
Solved! Go to Solution.
hello @Earl40
i am not sure if you can do this in pie chart.
if there is a pie, it means there is a value. But you can show zero in card visual that means you need to insert another visual.
however, i think i have seen a trick to manage this but if you have many pies (make a separation or something) but i doubt it will work if you want to show one pie with blank value.
Hope this will help.
Thank you.
Hi @Earl40
I agree with @Irwan. The Pie chart is to show how individual parts contribute to the whole. When the whole is 0, it cannot display 0 singly.
The trick is to use a Card visual to display the count value 0. Then use conditional formatting feature to set up the background and text color of the Card visual. Place this Card visual over the Pie chart to indicate that there is no data.
Steps are:
1. Create a [Count] measure and place it in a Card visual.
Count = COUNT('Table'[Category])+0
2. Create a measure for Card Text color.
Card Text Color = IF([Count]>0, "#FF000000") // "#FF000000" is a fully transparent color
3. Create a measure for Card Background color.
Card BG Color = IF([Count]>0, "#FF000000", "#FFFFFF")
4. Conditionally format the Card visual's Callout value and Background based on above two measures. Turn off Category label.
5. Move the Card visual over the Pie chart and adjust the visual size. Ensure the Card visual can fully cover the Pie chart when the Count is 0.
Result:
When the count is not blank
When the count is blank or zero
You can group two visuals later. Group visuals in Power BI Desktop reports - Power BI | Microsoft Learn
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Hi @Earl40
I agree with @Irwan. The Pie chart is to show how individual parts contribute to the whole. When the whole is 0, it cannot display 0 singly.
The trick is to use a Card visual to display the count value 0. Then use conditional formatting feature to set up the background and text color of the Card visual. Place this Card visual over the Pie chart to indicate that there is no data.
Steps are:
1. Create a [Count] measure and place it in a Card visual.
Count = COUNT('Table'[Category])+0
2. Create a measure for Card Text color.
Card Text Color = IF([Count]>0, "#FF000000") // "#FF000000" is a fully transparent color
3. Create a measure for Card Background color.
Card BG Color = IF([Count]>0, "#FF000000", "#FFFFFF")
4. Conditionally format the Card visual's Callout value and Background based on above two measures. Turn off Category label.
5. Move the Card visual over the Pie chart and adjust the visual size. Ensure the Card visual can fully cover the Pie chart when the Count is 0.
Result:
When the count is not blank
When the count is blank or zero
You can group two visuals later. Group visuals in Power BI Desktop reports - Power BI | Microsoft Learn
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Hi @Earl40
Could you please show what you expect to see in a situation where there is nothing in the visual based on the filters?
Do you mean a message to the user indicating that the result is 0, or something else?
hello @Earl40
i am not sure if you can do this in pie chart.
if there is a pie, it means there is a value. But you can show zero in card visual that means you need to insert another visual.
however, i think i have seen a trick to manage this but if you have many pies (make a separation or something) but i doubt it will work if you want to show one pie with blank value.
Hope this will help.
Thank you.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
100 | |
64 | |
44 | |
37 | |
35 |