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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

IF(ISBLANK(

Hi,

 

At first i had a simple divide to work out the % of cosistency ([Number of Consistent]/[Num Overscore]) however it wasnt accurate for ones that have 0% so i used an if formula if([Number of Consistent]/[Num Overscore]),([Number of Consistent]/[Num Overscore]),0). This would put 0% if for the values even if they had blank in them so ive tried adding an ifblank formula in but im having some trouble.

 

% Consistent = if(ISBLANK([Number of Consistent]/[Num Overscore],BLANK(),IF([Number of Consistent]/[Num Overscore],[Number of Consistent]/[Num Overscore],0)))

 

Any help is appreciated.

 

1 ACCEPTED SOLUTION
AnthonyTilley
Solution Sage
Solution Sage

If your problem is a divide by zero issue the use divide function instead of "/"

instead of [Number of Consistent]/[Num Overscore] use 

measure = DIVIDE([Number of Consistent],[Num Overscore],0) this will handle divide by zero issues

if you want to replace a value of 0% with a new value then use 

Measure =

var d = DIVIDE([Number of Consistent],[Num Overscore],0)

var ret = if(d = 0,
blank(),
d)
Return ret




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

 

Instead of a/b, use DIVIDE() in dax. Here , you can pass alternate value.
https://docs.microsoft.com/en-us/dax/divide-function-dax


In order to deal with blank values, use blank() with IF().

Do some workaround, It will easily solve your existing DAX calculation.

 

Thanks,
Amit

AnthonyTilley
Solution Sage
Solution Sage

If your problem is a divide by zero issue the use divide function instead of "/"

instead of [Number of Consistent]/[Num Overscore] use 

measure = DIVIDE([Number of Consistent],[Num Overscore],0) this will handle divide by zero issues

if you want to replace a value of 0% with a new value then use 

Measure =

var d = DIVIDE([Number of Consistent],[Num Overscore],0)

var ret = if(d = 0,
blank(),
d)
Return ret




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




AnthonyTilley
Solution Sage
Solution Sage

If your problem is a divide by zero issue the use divide function instead of "/"

instead of [Number of Consistent]/[Num Overscore] use 

measure = DIVIDE([Number of Consistent],[Num Overscore],0) this will handle divide by zero issues

if you want to replace a value of 0% with a new value then use 

Measure =

var d = DIVIDE([Number of Consistent],[Num Overscore],0)

var ret = if(d = 0,
blank(),
d)
Return ret




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




AnthonyTilley
Solution Sage
Solution Sage

If your problem is a divide by zero issue the use divide function instead of "/"

instead of [Number of Consistent]/[Num Overscore] use 

measure = DIVIDE([Number of Consistent],[Num Overscore],0) this will handle divide by zero issues

if you want to replace a value of 0% with a new value then use 

Measure =

var d = DIVIDE([Number of Consistent],[Num Overscore],0)

var ret = if(d = 0,
blank(),
d)
Return ret




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




AnthonyTilley
Solution Sage
Solution Sage

a little unsure on your issue is it a divide by zero issue or a replace value 0 with diffrent value

if your having a divide by zero isue for example 100/0 = error then use divide function instead of [Number of Consistent]/[Num Overscore]

DIVIDE([Number of Consistent],[Num Overscore],0)
 
this will solve the devide by zero issue and replace any errors with 0

if your wanting to take any value that is returned 0% for example 0/100 = 0% and you want to replace with blank then use something like this

Measure =

var d = DIVIDE([Number of Consistent],[Num Overscore],0)

var ret = if(d = 0,
blank(),
d)
Return ret
 
this will replace any 0 values with blank 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




AnthonyTilley
Solution Sage
Solution Sage

a little unclear as to what your issue is with this one.

 

are you having a divide by Zero error - if so instead of using [Number of Consistent]/[Num Overscore]

use a divide as this will handle the divide by zero issue and allow you to simply defult to 0%

DIVIDE([Number of Consistent],[Num Overscore],0)
 
or are you wanting anything that results in a 0% to show a diffrent value 
for example 0/100 = 0% but you want to show these as Blank instead

Measure =

var d = DIVIDE([Number of Consistent],[Num Overscore],0)

var ret = if(d = 0,
blank(),
d)
Return ret
 
this will replace any result of 0 with a blank




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.