Forum Discussion
Replacing (Blanks) with 0
- 8 years ago
so you are using the raw source data, is it correct?
So its easy to you just make new column with this code
Column = IF(ISBLANK(**original column**),0,**original column**)
**original column** - your name for the column you are using.
Then change the value to the new column and it should work :)
Adding +0 to the end of your measure is one quick way to fix this, or adding a new measure that looks at the existing one, and does a simple "if blank then 0 else existing measure" replacement
- mycauldron3 years agoNew Member
Simple, as jthomson states. Create your Measure then add +0
Below is a measure to count the number of 2008 OS as it came up (Blank) made my report ugley.
Count of OS for Windows Server 2008 =
CALCULATE(
COUNTA('Company'[OS]),
'Company'[OS]
= "Windows Server 2008"
) +0
- astorey13 years agoFrequent Visitor
Great quick Solution 🙂
- mohammadyousaf5 years agoResolver II
Thank you, I just added the 0 after ) and it worked for me. simplest solution ever.
- Espen15158 years agoAdvocate I
Hi, I am simply using a card where I COUNT and filter on a particular field. I don't think I am using a measure. When you say measure here, do you mean that I should create a new column that copies the column, but using the if function instead?
- Pavlous8 years agoAdvocate II
so you are using the raw source data, is it correct?
So its easy to you just make new column with this code
Column = IF(ISBLANK(**original column**),0,**original column**)
**original column** - your name for the column you are using.
Then change the value to the new column and it should work :)
- Espen15158 years agoAdvocate I
Hi,
Yes, that is correct. I will try that. I was just hoping that I would not have to create a whole new column and instead just select a format or something like that on my Card. Something like "display blanks as "-" or display blanks as 0, etc. Power BI should have a function like that in order to minimize the amount of tampering with source data. :-)