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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Roym
Helper IV
Helper IV

Show zero instead of blank for cards

I have a lot of cards in my report in various places. Some use measures and some show just numbers that are filtered inside the card itself. Now I have various cards that sometimes, depending on the selection, show (blank). I would prefer to show a '0' instead. I know that for the measures it is possible to do a 'if blank' but as not all cards are using measures I was wondering if there is another way to fix this?

1 ACCEPTED SOLUTION
FPackermanGTA
Frequent Visitor

Hi,

 

I was looking to do this the other day and was able to find a workaround on these forums also.

 

Look in the format options of the card under the paintbrush and expand Category Label then right click on the colour and choose Conditional Formatting.

 

FPackermanGTA_0-1633764745616.png

 

Change the Format by to 'Rules' and choose the field the card is displaying. For the rule choose is blank and change the color to whatever your background colour is so even though the card is displaying blank the rule will kick in and effectively hide the words {Blank}. Although not ideal this was the next best thing I was able to do.

 

FPackermanGTA_1-1633764867714.png

 

 

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

For a simple counter in the card visual, a custom calculated column using an IF statement (expression,0,1) puts a zero in the counter when the sum,min,max,count,or count(distinct) is zero.  

31-60DaysOut = IF('Sheet1'[DaysOut] > 30 && 'Sheet1'[DaysOut] <= 60,1,0)
 
@PowerBI Ideally, the card visual would detect the whole number or decimal format of the field and put a zero instead of the work "Blank".
FPackermanGTA
Frequent Visitor

Hi,

 

I was looking to do this the other day and was able to find a workaround on these forums also.

 

Look in the format options of the card under the paintbrush and expand Category Label then right click on the colour and choose Conditional Formatting.

 

FPackermanGTA_0-1633764745616.png

 

Change the Format by to 'Rules' and choose the field the card is displaying. For the rule choose is blank and change the color to whatever your background colour is so even though the card is displaying blank the rule will kick in and effectively hide the words {Blank}. Although not ideal this was the next best thing I was able to do.

 

FPackermanGTA_1-1633764867714.png

 

 

Niceee, indeed not ideal but this works perfectly as a workaround. Didn't think about this.

In fact, I think it is a great solution because it avoids creating more measures. I'll take it, thanks!

YukiK
Impactful Individual
Impactful Individual

Other than saying 0 if blank, you can also add "+ 0" in your measure.

Your Measure = SUM(Table[Sales]) + 0

Very basic!! Excellent!!! The best answer!!

PC-BI
Frequent Visitor

Thanks @YukiK, this was a perfect and simple solution to resolve this issue 🙂

This is a great solution! Thank You!

parry2k
Super User
Super User

@Roym no other way, you have to use measure and then make it zero in case of blank

 

Measure with Zero = COALESCE ( [Your Measure], 0 )

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.