A
C
- CALCULATE
- CALCULATETABLE
- CALENDAR
- CALENDARAUTO
- CEILING
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CLOSINGBALANCEMONTH
- CLOSINGBALANCEQUARTER
- CLOSINGBALANCEYEAR
- COALESCE
- COLUMNSTATISTICS
- COMBIN
- COMBINA
- COMBINEVALUES
- CONCATENATE
- CONCATENATEX
- CONFIDENCE.NORM
- CONFIDENCE.T
- CONTAINS
- CONTAINSROW
- CONTAINSSTRING
- CONTAINSSTRINGEXACT
- CONVERT
- COS
- COSH
- COT
- COTH
- COUNT
- COUNTA
- COUNTAX
- COUNTBLANK
- COUNTROWS
- COUNTX
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNCD
- COUPNUM
- COUPPCD
- CROSSFILTER
- CROSSJOIN
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENTGROUP
- CUSTOMDATA
D
E
I
N
O
P
R
S
- SAMEPERIODLASTYEAR
- SAMPLE
- SEARCH
- SECOND
- SELECTCOLUMNS
- SELECTEDMEASURE
- SELECTEDMEASUREFORMATSTRING
- SELECTEDMEASURENAME
- SELECTEDVALUE
- SIGN
- SIN
- SINH
- SLN
- SQRT
- SQRTPI
- STARTOFMONTH
- STARTOFQUARTER
- STARTOFYEAR
- STDEVX.P
- STDEVX.S
- STDEV.P
- STDEV.S
- SUBSTITUTE
- SUBSTITUTEWITHINDEX
- SUM
- SUMMARIZE
- SUMMARIZECOLUMNS
- SUMX
- SWITCH
- SYD
T
U
In this article, we will discuss in detail how to use the Power BI DAX function ISLOGICAL.
Syntax of the ISLOGICAL Function
The ISLOGICAL function takes one argument, which can be any value. The syntax for the ISLOGICAL function is as follows:
ISLOGICAL(value)
The value argument is the value that you want to test for being a logical value. It can be a column reference, a scalar value, or an expression.
Examples of Using ISLOGICAL Function
Let's look at some examples of using the ISLOGICAL function in Power BI.
Example 1: Testing If a Value is a Logical Value
Suppose we have a table named 'Sales' that contains a column named 'IsPromoted'. The 'IsPromoted' column contains values TRUE and FALSE, which indicate whether a sale was promoted or not.
To test if the values in the 'IsPromoted' column are logical values, we can use the following DAX formula:
=ISLOGICAL(Sales[IsPromoted])
This formula will return TRUE if the values in the 'IsPromoted' column are logical values, otherwise, it will return FALSE.
Example 2: Using ISLOGICAL Function in Combination with Other Functions
Suppose we want to calculate the total number of promoted sales in the 'Sales' table. We can use the following DAX formula to achieve this:
=COUNTIF(Sales[IsPromoted],TRUE)
The COUNTIF function counts the number of cells that meet a certain condition. In this case, we are counting the cells in the 'IsPromoted' column that contain the value TRUE.
However, before using the COUNTIF function, we need to make sure that the values in the 'IsPromoted' column are logical values. We can do this by using the ISLOGICAL function in combination with the IF function.
The following DAX formula will convert the values in the 'IsPromoted' column to logical values:
=IF(ISLOGICAL(Sales[IsPromoted]),Sales[IsPromoted],FALSE)
This formula will return the values in the 'IsPromoted' column if they are already logical values. Otherwise, it will return the value FALSE.
We can now use the COUNTIF function with the modified 'IsPromoted' column to calculate the total number of promoted sales.
In conclusion, the ISLOGICAL function in Power BI is a useful function for testing whether a value is a logical value or not. It is commonly used in combination with other DAX functions to perform complex calculations. By using the examples and syntax discussed in this article, you can start using the ISLOGICAL function in your Power BI reports and dashboards.