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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CF123
Frequent Visitor

Represent weekly stats using cards, show 0 when there is no stat

I am using cards to show several key stats in my risk report. The cards show the number of new risks, reopened risks, closed risks and overdue risks. Now I want to show the RAG break of each of these stats using smaller cards e.g. show the number of new risks with green status, amber status and red status. If there are no risks for that RAG status, I want the card to show 0. This is what I have created so far:

CF123_1-1679030138017.png

I am having difficult setting this up when my data set doesn't have the desired value in it. e.g. if my data set doesn't have any red overdue risks, I am unable to filter my card for red 

 

Here's a sample of my dataset 

Risk IDRAGStatusOverdue?
R-1RedNewNo
R-2AmberNo changeYes
R-3AmberNo changeYes
R-4GreenReopenedNo
R-5RedNewNo
R-6AmberNewNo
R-7AmberNewNo
R-8GreenClosedNo
R-9RedClosedNo
R-10AmberNo changeYes
1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @CF123 ,

You can refer the following links to replace the blank values with "0"s:

1. +0

Display “0” instead of “(Blank)” in Card Visualization in Power BI – Power BI Trick

2. Using COALESCE function

Power BI Pro Tip: show 0 instead of (Blank)

TotalSales = COALESCE(SUM('Sales'[SalesAmount]),0)

 

If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi @CF123 ,

You can refer the following links to replace the blank values with "0"s:

1. +0

Display “0” instead of “(Blank)” in Card Visualization in Power BI – Power BI Trick

2. Using COALESCE function

Power BI Pro Tip: show 0 instead of (Blank)

TotalSales = COALESCE(SUM('Sales'[SalesAmount]),0)

 

If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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