cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
DouweMeer Member
Member

isblank <> blank ?

I created the following table:

 

selectcolumns ( 'table' , "stuff" , 'table'[A] )

I was unable to transform the column [stuff] into numbers, thus I checked the data. I created a custom column with the following boolean:

if ( iserror ( value ( [stuff] ) * 1 ) , 1 , 0 )
It appeared that the field that were not able to transform into a value were blank. Or at least, appeared to be so.

So I modified my original table reference:

selectcolumns ( 'table' , "stuff" , if ( isblank ( 'table'[A] ) , "0" , 'table'[A] ) )

This didn't work... the field were still empty.

So I checked with a new boolean.

if ( [stuff] = blank() , 1 , 0 ). 

All empty lines were returning 1 as if they were blank. If the field is blank, therefor the statement:

if ( isblank ( blank () ) , true , false )

...should return false, but it doesn't. 

 

How comes that if a field is considered to be 'blank' in the [field] : blank() = true, but the statement isblank ( [field] ) returns false? Because I thought the way you can split 0 and blank was by using the isblank statement... but that doesn't work apparently...

5 REPLIES 5
ChrisMendoza Senior Member
Senior Member

Re: isblank <> blank ?

@DouweMeer -

Remarks from @ https://dax.guide/blank/

The BLANK value is automatically converted in case it is compared with other values.
The right way to check whether a value is BLANK is by using either the operator == or the ISBLANK function. Do not use the operator “=”.
The operator == is a “strictly equal to” operator that consider BLANK as a different value other than 0 or an empty string.
See related articles for more details.

 

Check out the related articles as well.

DouweMeer Member
Member

Re: isblank <> blank ?

Could it be that the imported "" from Excel (which is [stuff] ) is treated differently than 0 or blank() ?

 

Untitled.png

Community Support Team
Community Support Team

Re: isblank <> blank ?

Hi @DouweMeer .

I'd like to suggest you take a look at below blog from @marcorusso, it mentioned how to use 'blank' value and compare with conditions in dax:

Handling BLANK in DAX 
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
DouweMeer Member
Member

Re: isblank <> blank ?

@v-shex-msft 

I do understand the 'blank' values, but I find it weird that in a cell that does not show a value returns me a False result when verified with isblank. 

Assumption: due to not showing a value in my table, the value is not 0, not " " and therefore it is blank. 

This line from your weblink:

IF ( ISBLANK ( BLANK () ), "true", "false" ) = true

In my report it does not return 'true' as suggested by the site, but it returns 'false'. 

 

Statement: Field value is not displayed in the table view, thus suggests to be blank...

Below the boolean expressions with the values returned.

if ( [stuff] == BLANK() , 1 , 0 ) = 0
if ( ISBLANK( [stuff] ) , 1 , 0 ) = 0
if ( [stuff] = BLANK() , 1 , 0 ) = 1
iferror ( if ( value ( [stuff] ) = 0 , 1 , 0 ) , 2 ) = 2
iferror ( if ( value ( trim ( [stuff] ) ) = 0 , 1 , 0 ) , 2 ) = 2
iferror ( if ( [stuff] = " " , 1 , 0 ) , 2 ) = 0
 
Would you be so kind and explain met how the results above do match with the logic mentioned on the webpage of the links you both posted?
DouweMeer Member
Member

Re: isblank <> blank ?

@v-shex-msft , it looks like it is a linefeed character 0A:

 

When the editor reads a file it collects characters up until a linefeed, replaces the newline with a null (hex 00) and saves the collected characters as a line in your buffer. The point to note is that the linefeed is not saved. It is stripped on a read and added to the end of each line when the file is written.

 

I've reported it as a bug. 

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)