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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Replacing Card Content if value is Blank

I have the following tables

 

    Books with columns:

          BookCode

          BookType

          PublicationYear

    Revnue with columns:

          BookCode

          BookRevenue

 

I have a Card View, that displays the sum of the column BookRevenue, with the following filters set:

 

On column BookType the filter is set to Fiction

On column PublicationYear filter is set to 2020

 

What I see now, is the word Blank when there is no BookRevnue for 2020. How do I get it to display 0 instead of Blank.

 

I am really new to DAX and was trying to the ISBLANK statement, but getting nowhere with it, in addition to having trouble with the filters. Anhy ideas?

9 REPLIES 9
dax
Community Support
Community Support

Hi @Anonymous , 

You could try above suggestions. If this doesn't work, please correct me and inform me more detailed information(such as your expected output and your sample data )? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

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

BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Just add '+0' without apostrophes to the end of whatever measure you want to show zero instead of (Blank) for.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




parry2k
Super User
Super User

@Anonymous you can create a measure like this

 

Amount = SUM ( BookRevenueTable[Book Revenue] ) + 0

and use above measure in the card visual

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.

Anonymous
Not applicable

How would this handle the filters?

@Anonymous what about filters?



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.

Anonymous
Not applicable

from my question:

 

I have a Card View, that displays the sum of the column BookRevenue, with the following filters set:

 

On column BookType the filter is set to Fiction

On column PublicationYear filter is set to 2020

 

Your soliution will provide all the sum of All BookRevenue, when I only need the sum of BookRevnue, when BookType is Fiction and ProductionYear is 2020

@Anonymous do you have set the relationship between your tables? you should set a relationship on BookCode between these two tables, and once it is done the same measure will work when you filter on those columns.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.

Anonymous
Not applicable

Yes, I set the relationships already. Are you saying that the filters are set visually, to the card I apply the measure to?

@Anonymous if you have slicer on the page for those columns, as you select a value, card visual value will change. Tables get filtered once you choose the value and based on the filter applied on the tables, you measure will updates accordingly and so do card visual. You have to test it to check the result and then ask the question otherwise my answers are not going to make sense. if something doesn't work, please explain what is not working and what you have tried.



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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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