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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
desarrolloaudit
New Member

Replacing (blank) with 0

I am trying to replace the value (Blank) in a number card with 0, but when performing the formula I get this error (Expressions that yield variant data-type cannot be used to define calculated columns.) How can I fix it?

 

The formula is: 

Column = IF(ISBLANK('Formato medidas de prevencion'[Medida de prevención implementada]),0,'Formato medidas de prevencion'[Medida de prevención implementada])
1 ACCEPTED SOLUTION

@desarrolloaudit you have to simply add a measure like this and use this on each card as you are filtering each card

 

Count = COUNTROWS ( Table) + 0

 

Use above measure in each card.

 

 

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.

View solution in original post

9 REPLIES 9
Anand24
Super User
Super User

Hi @desarrolloaudit ,

 

You can do this very easily with Power Query Editor(PQE) in following steps:

Open PQE -> Right-Click on the column name -> Replace Values -> Keep value to Find blank and type 0 in Replace with field -> OK 

 

Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!

@Anand24

It didn't work

desarrolloaudit_0-1597265650002.png

@desarrolloaudit you have to simply add a measure like this and use this on each card as you are filtering each card

 

Count = COUNTROWS ( Table) + 0

 

Use above measure in each card.

 

 

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.

parry2k
Super User
Super User

@desarrolloaudit you can simply do +0

 

Measure = SUM ( Tabe[Amount] ) + 0

 

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.

@parry2k 

What happens is that the values of that column are text, and the card only counts how many times that value appears in the column

@desarrolloaudit doesn't matter if it is a count of a text column or a sum of number column, at end both returns a number and +0 will do it.

 

If that's not your question, provide more context with examples. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

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.

@parry2k 

 

When I create the measure with the formula you gave me, I get this error

 

Captura1.PNGCaptura2.PNGCaptura3.PNG

@desarrolloaudit I don't know what is the datatype of your columns, if you are trying to sum your text column, it will not work, you need to share sample data and what you are trying to achieve. if it is a text column then use count instead of sum. I'm shooting in the dark here, 



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.

@parry2k 

 

I have this database with records of several people and in front it has an action that that person performed, the action column [Medida de prevención implementada] is in text format

 

Captura3.PNG

 

I create these cards so that PowerBI can tell me how many records each action has using the filter so that the card selects only a specific action, along with the total sum of all the records that is in green

 

Captura2.PNG

 

When I select a person who has 0 values in any action it appears on the card (Blank), I want to replace that (Blank) with the value 0

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.