TRUE

How to Use the Power BI DAX function TRUE

Syntax

The syntax for the TRUE function is straightforward:


TRUE()


As you can see, the function takes no arguments. It simply returns the Boolean TRUE value.

Usage

The TRUE function is most commonly used in conjunction with other logical functions in DAX. For example, the IF function can be used to evaluate a condition and return a value if it is true, or a different value if it is false. Let's take a look at an example:


=IF(Sales[SalesAmount] ❱ 10000, “High”, “Low”)


In this example, we are using the IF function to evaluate whether the SalesAmount in the Sales table is greater than 10000. If it is, the function returns the string "High". If it is not, the function returns the string "Low". However, what if we want to return a Boolean TRUE value instead of a string? This is where the TRUE function comes in:


=IF(Sales[SalesAmount] ❱ 10000, TRUE(), FALSE())


In this modified example, we are using the IF function to evaluate whether the SalesAmount in the Sales table is greater than 10000. If it is, the function returns the Boolean TRUE value. If it is not, the function returns the Boolean FALSE value.

The TRUE function is a simple but powerful function in DAX. It is used to return the Boolean TRUE value and is commonly used in conjunction with other logical functions to evaluate conditions and return a result. By using the TRUE function in your DAX formulas, you can create more powerful and flexible calculations in Power BI.

Power BI DAX Training Courses by G Com Solutions (0800 998 9248)

Upcoming Courses

Contact Us

    Subject

    Your Name (required)

    Company/Organisation

    Email (required)

    Telephone

    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)