Forum Discussion
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:
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) + 0Use 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.⚡
9 Replies
- parry2kSuper User
desarrolloaudit you can simply do +0
Measure = SUM ( Tabe[Amount] ) + 0I 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.⚡
- desarrolloauditNew Member
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
- parry2kSuper User
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/38490I 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.⚡
- Anand24Super 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 !!!
- desarrolloauditNew Member
- parry2kSuper User
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) + 0Use 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.⚡