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

Unable to replace Null values with 0

Hi,

I am unable to replace null values  '-'  with 0.

I am using if(IsNull((Count(iD))),0,(Count(iD)))

Attaching my app for better understanding.

Regards,

Vinayak

17 Replies
Not applicable
Author

Hi Raju,

Thanks for taking out your time for this discussion.
So if there a way that I can change that to 0.
for example in excel I used to use iferror

Regards,

Vinayak

rittermd
Master
Master

I have not found a way to do this in the App. 

Possibly you could replace nulls with a 0 in your script when loading.  Not sure if that will work for you or not.  But it might be your only option.

chaudharic3333
Contributor
Contributor

Try using the below formula in your measure.

 

if(count({1} <your dimension>) > 0, (<your Measure>),0)

chaudharic3333
Contributor
Contributor

Try using the below formula in your measure.

 

if(count({1} [your dimension]) > 0, ([your Measure]),0)

 

 

Make sure you enable Show Value Labels to show the nulls as 0

Vegar
MVP
MVP

Have you tried the ALT() function? 

=ALT(Count(iD),0)

 

The alt function returns the first of the parameters that has a valid number representation. If no such match is found, the last parameter will be returned. Any number of parameters can be used.

manoranjan_d
Specialist
Specialist

pls implement the if condition in script level and not in the expression of the chart.

like below example

LOAD

if(len("Type")=0,'0',"Type") as Type
FROM [lib://Test/Book1.xlsx]
(ooxml, embedded labels, table is Sheet1); 

manoranjan_d
Specialist
Specialist

in the script its possible

The_Squirrel
Partner - Contributor II
Partner - Contributor II