Power BI - DAX Information Functions



The task is given to Richard to manipulate the essential DAX information systems functions by either creating a new measure or developing a new column where DAX information system expression needs to be written. The DAX information system function computed the expression based on the parametric value inside the defined function that referred to specific field values in the dataset.

Types of DAX Information Systems Functions

The various types of DAX information systems functions are discussed below −

CONTAINS Function

If the field value is presented in the field then the CONTAINS() function retrieves True otherwise, it will retrieve False.

Example − You can enter the DAX expression for the new measure −

ln = CONTAINS(Sheet1,Sheet1[CS Ticket],13,Sheet1[CSAT],.11)

Here, "ln" specifies the new measure name, and the first parameter denotes the table name and the second parameter denotes the field name, the third parameter shows the numeric value 13 that needs to be searched in the "CS Ticket" column, the fourth parameter represents another column "CSAT" and the fifth parameter ".11" denotes the other decimal value that needs to be searched in the "CSAT" column. If both columns contain these supported values, then the defined measure "ln" returns True else returns False.

CONTAINS Function

CONTAINS Function 1

CONTAINSSTRING Function

This function retrieves false if the target text is not presented in another text string otherwise retrieves True and is not case-sensitive.

Example − You can enter the expression −

stg = CONTAINSSTRING("sunpharmacompany", "sun")
CONTAINSSTRING Function

As you can notice in the screenshot, the resulting value is "True" as the second text "sun" is resided in the first text "sunpharmacompany".

CONTAINSSTRINGEXACT Function

CONTAINSSTRINGEXACT function returns false if the second text string is not found either in the first text string or in the specific column. Unlike the CONTAINSSTRING function, this function is case-sensitive.

You can enter the expression in the formula bar.

ck = CONTAINSSTRINGEXACT('Sheet1'[Data Resources],"Hotels")

Here, ck denotes the new column. The given expression returns True if the text "String" is found in the corresponding "Data Resources" column.

CONTAINSSTRINGEXACT Function

ISBLANK Function

It retrieves the Boolean values. It would return False if the field value is not blank.

Example − You may write the expression −

bln = ISBLANK(Sheet1[Active/Inactive customers])
ISBLANK Function

ISEVEN Function

It will verify whether the parameter is odd or even and return True if the parameter contains an even value else retrieve False.

Example − You may enter the given expression in the formula bar −

az = iseven(2221)

Go to the Report view and select the table visually. Then select the "AZ" measure from the Data pane to display its output. The output of the defined measure returns False as the parametric value "2221" is odd.

ISEVEN Function

ISODD Function

It will retrieve the Boolean values according to the passing parameters given to the ISODD function.

Write the expression for the new measure named ds

ds=ISODD(33333)
ISODD Function

You can conclude that the ds measure returns the True as the given argument "33333" is odd.

ISNUMBER Function

It retrieves only Boolean values. The ISNUBMER function retrieves false if the specified field value is not a number and vice versa.

Example − Enter the expression in the formula bar and press enter −

IS_NUMBER = ISNUMBER(Sheet1[CSAT])
ISNUMBER Function

ISTEXT Function

This function retrieves the boolean values and verifies whether the given value is a string or not. It returns a False value if the defined value is not text and vice versa.

Example − Enter the expression for the new column −

tx = ISTEXT(Sheet1[Customer_id])
ISTEXT Function

As you can observe in the screenshot, the "tx" column contains all the False values because "Customer_id" comprises only numeric values.

ISNONTEXT Function

It is just opposite to the ISTEXT() function. It confirms whether the specified value is a String or not. If the non-text field values persist in the table, it will retrieve the True value; if not, it will retrieve the False value.

Note the Blank values are not considered as a Text value.

Example − You can write the formula −

non_tx = ISNONTEXT(Sheet1[Resources popularity])
ISNONTEXT Function

After the verification of the expression, the "non_tx" column comprises only a False value because every value in the "Resources popularity" column is text.

ISERROR Function

This function retrieves True if the parametric value contains an error otherwise, it will retrieve False.

You can enter the expression −

stg = ISERROR(1/0)
ISERROR Function

DAX Information Systems Functions

The list of important DAX Information systems functions along with their explanation is specified in the given table −

Functions Explanation
CONTAINS It retrieves False if the designated value is not found in the referral field and vice versa.
CONTAINSSTRING It retrieves the True if the designated value is found to be Text in the referral field and vice versa.
CONTAINSROW It retrieves False if the field value persists in the loaded table and vice versa.
COLUMNSTATISTICS It retrieves the new table that contains the extensive statistics details of all columns in the loaded dataset.
CONTAINSSTRINGEXACT It is case-sensitive, verify whether the parametric value persists in the referral field or not.
HASONEFILTER It retrieves False if the directly filtered's count on the referral field is one and vice versa.
HASONEVALUE It retrieves False if the referral column is not filtered to atomic value, otherwise, it will retrieve True.
ISBLANK It retrieves True if the referral field contains a blank, otherwise, it retrieves False.
ISERROR It retrieves False if the parametric value does not error and vice versa.
ISLOGICAL It retrieves True if the parametric value contains a logical value like a boolean value and vice versa.
ISODD It retrieves True if the parametric value is odd, otherwise, it will retrieve False.
ISAFTER It returns false for a row that does not fulfil all the parametric constraints defined in the function and vice versa.
ISEVEN It retrieves False if the parametric value is not even and vice versa.
ISTEXT It verifies whether the given value is text or not and returns the True for the String and vice versa.
ISNONTEXT It verifies whether the given value is text or not and returns the Boolean values accordingly.
ISSUBTOTAL It is generally employed with a summarized function to generate a new field whose resulting value may be True or False based on the condition that if the row comprises the subtotal of the parametric field, then it will retrieve True, or otherwise, it will retrieve False.
NONVISUAL It appears as a non-visual field value in an expression named SUMMARIZECOLUMNS.
SELECTEDMEASURE As soon as the format text or computation item has been calculated, it retrieves the pointer to the measure in the expression.
Advertisements