ISBLANK Function is a POWER BI Information function in DAX that checks whether a value is blank, and returns TRUE If value is blank else returns FALSE.
SYNTAX
ISBLANK(<value>)
value is the value or expression that is to be checked for blank.
Lets look at an example of ISBLANK function.
To demonstrate this, lets quickly create a sample table using a DATATABLE function as shown below.
Following DAX expression, uses DATATABLE function that creates a table named StudName which contains two columns StudId, and Name as shown below.
StudtName = DATATABLE ( "StudId", INTEGER, "StudName", STRING, { { 1, "Ajay Kumar" }, { 2, BLANK () }, { 3, "Ramesh Singh" }, { 4, "Sujoy Ghosh" }, { 5, "Grish Kumar" }, { 6, "Sanjay Singh" }, { 7, BLANK () }, { 8, "Mayank Rawat" } } )
You will notice that there are two blank values in StudName which is kept purposuly to demonstate the ISBLANK function working.
Lets take this data into table visual as shown below.
Using ISBLANK Function to check the BLANK value in column
Lets create a calculate column named Chk_Isblank in table which uses ISBLANK function to check whether the value in StudName column is blank or not and returns the TRUE or FALSE.
Chk_Isblank = ISBLANK(StudName[StudName])
After commit the DAX, Lets drag the measure to table values next to StudName column.
As you can see, for blank value in StudName column ISBLANK function returns TRUE and FLASE for non blank values.
Replace blank values with Alternate values
In case if you want to return any alternate value when ISBLANK function returns TRUE or FALSE then you can use ISBLANK function with DAX IF function.
Lets say, In for blank StudName value you want to display “Not Avaliable” and for non-blank display studName as it is then you can modify above DAX as shown below.
Chk_Isblank = IF ( ISBLANK ( StudtName[StudName] ), "Not Available", StudtName[StudName] )
Once you commit the DAX, you will see that it returns the “Not Available” for blank StudName.
Also Read..