DAX Information Function in Power BI

Introduction

 
In this article, you will learn a very interesting category of DAX functions i.e. ‘Information Function’. In my previous articles, I have covered some other categories od DAX like ‘Date & Time Function’, ‘Time Intelligence Functions’, and ‘Logical functions’. As the name suggests, the information functions give us information in the term of ‘True’ or ‘False’.
 
DAX information functions look at the table, column, or row that is provided as an argument and informs you whether the value matches the expected type or not. For example, the ISERROR function returns TRUE if the value that you reference contains an error. There are many information functions used in Power BI. Let's have a look at them.
 

CONTAINS

 
Returns TRUE if there exists at least one row where all columns have specified values.
 
Syntax- CONTAINS(Table, ColumnName1, Value1, …)
 
Table- Any expression that returns a table.
 
ColumnName
 
Name of any column of the existing table, using DAX syntax. It cannot be an expression.
 
Value1
 
Any expression that returns a scalar value.
 
Ex
 
The below example tells us that the CreditCard table has a CardNumber 11112040199986 with a given ID 31.
 
DAX Information Function in Power BI
 

CONTAINSROW

 
Returns TRUE if there exists at least one row where all columns have specified values.
 
Syntax- CONTAINSROW (Table, Value1, …)
 
Table- Any expression that returns a table
 
Value1- Any expression that returns a scalar value.
 
Ex.
 
DAX Information Function in Power BI
 

CONTAINSSTRING

 
Returns TRUE if one text string contains another text string. CONTAINSSTRING is not case sensitive.
 
Syntax- CONTAINSSTRING(WithinTxt, FindTxt)
 
WithinText- The text in which you search the ‘FindText’
 
FindText- Text that you want to find.
 
Ex.
 
DAX Information Function in Power BI
 

CONTAINSSTRINGEXACT

 
Returns TRUE if one text string contains another text string same as CONTAINSSTRING but the only difference between these two is ‘CONTAINSSTRINGEXACT’ is case-sensitive.
 
Syntax- CONTAINSSTRINGEXACT(WithinTxt, FindTxt)
 
WithinText- The text in which you search the ‘FindText’
 
FindText- Text that you want to find.
 
Ex.
 
DAX Information Function in Power BI
 

ISBLANK

 
Checks whether a value is blank and return TRUE or FALSE.
 
Syntax- ISBLANK(Value)
 
Value- The value or expression that you want to test.
 
Ex.
 
DAX Information Function in Power BI
 

ISCROSSFILTERED

 
Returns TRUE when the specified table or column is cross filtered.
 
Syntax- ISCROSSFILTERED(TableNameOrColumnName)
 
TableNameOrColumnName- Name of existing table or column, using DAX syntax
 
Ex.
 
DAX Information Function in Power BI
 

ISEMPTY

 
Returns TRUE if the specified table or table-expression is empty.
 
Syntax- ISEMPTY(Table)
 
Table- A table or an expression that returns table.
 
Ex.
 
DAX Information Function in Power BI
 

ISERROR

 
Check whether a value is an error and return TRUE or FALSE accordingly
 
Syntax- ISERROR(Value)
 
Value-The value you want to test.
 
Ex.
 
DAX Information Function in Power BI
 

ISEVEN

 
Returns TRUE if the number is even, or FALSE if the number is odd.
 
Syntax- ISEVEN(Number)
 
Number- Any number to test. If the number is not an integer, then it will be truncated.
 
Ex.
 
DAX Information Function in Power BI
 
DAX Information Function in Power BI
 

ISFILTERED

 
Returns TRUE when there are direct filters on the specified column.
 
Syntax- ISFILTERED(TableNameOrColumnName)
 
TableNameOrColumnName- Any existing table or column.
 
Ex.
 
DAX Information Function in Power BI
 

Summary

 
These are some DAX information functions. The rest of the functions I will explain in the next article. So, stay with us. Thanks for reading.