Dax Function: EXACT

Category: Text Functions

The EXACT function in Power BI is a DAX function used to compare two text strings. It checks for an exact match between the two strings, including case sensitivity, and returns a Boolean value (TRUE or FALSE).

Purpose

The function ensures that two text strings are identical, considering both content and case.

Calculations Performed

It performs a case-sensitive comparison of two text values.

Practical Use Cases

  • Validating data consistency in a dataset.
  • Performing case-sensitive filtering or conditional logic.
  • Comparing user inputs or predefined strings.

EXACT(text1, text2)

ParameterTypeDescription
text1Text/ScalarThe first text string to compare.
text2Text/ScalarThe second text string to compare with the first.

How Does EXACT Dax Function Works

The EXACT function evaluates whether the two input text strings are identical by:

  • Checking each character for a match.
  • Considering case sensitivity (e.g., “Apple” ≠ “apple”).
  • Returning TRUE if all characters, including case, match perfectly.

What Does It Return?

The function returns a Boolean value:

  • TRUE if the two strings are exactly the same, including case.
  • FALSE otherwise.

When Should We Use It?

  • Case-Sensitive Comparisons: When the comparison must differentiate between uppercase and lowercase letters.
  • Data Validation: Ensuring data integrity by checking for exact text matches.
  • Conditional Logic: Building conditions where output depends on a precise match.

Examples

Basic Usage

Comparing two text values directly.


EXACT("Power BI", "Power BI")

Result: TRUE

Column Usage:

Comparing values from two columns for exact matches.


EXACT('Table1'[Column1], 'Table1'[Column2])

Result: A column of TRUE or FALSE values depending on the comparison.

Advanced Usage

Combining with conditional logic to label mismatches.


IF(EXACT('Table1'[Column1], 'Table1'[Column2]), "Match", "Mismatch")

Result: Returns “Match” if the texts are identical, otherwise “Mismatch.”

Tips and Tricks

  • Case Sensitivity: This function is strictly case-sensitive. If case does not matter, consider using other functions like UPPER or LOWER to normalize the text before comparison.
  • Error Handling: Handle null or empty string scenarios explicitly using functions like BLANK or IF to avoid errors.
  • Performance: Use this function sparingly in large datasets, as it processes comparisons row by row.

Performance Impact of EXACT DAX Function:

  • For large datasets, consider pre-processing the data to minimize redundant comparisons.
  • If case-insensitive comparisons are needed, normalize text using UPPER or LOWER before applying the EXACT function.

Related Functions You Might Need

  • IF: For implementing conditional logic based on the result of the EXACT function.
  • UPPER: Converts text to uppercase before comparison.
  • LOWER: Converts text to lowercase before comparison.
  • CONCATENATE: Joins strings before performing a match check.

Want to Learn More?
For more information, check out the official Microsoft documentation for EXACT You can also experiment with this function in your Power BI reports to explore its capabilities.

Unlock the full capabilities of Power BI and elevate your data insights with our specialized consulting services. Whether you need guidance on advanced DAX functions like those highlighted here, support in designing interactive dashboards, or expertise in optimizing data models for enhanced performance, our experienced Power BI consultants are equipped to deliver customized solutions for your business. Explore our Power BI Consulting Services page to discover how we can help your organization make smarter, data-driven decisions.

1. What does the EXACT function do in Power BI?

It performs a case-sensitive comparison of two text strings and returns TRUE if they match exactly.

2. Is the EXACT function case-sensitive?

Yes, the comparison is strictly case-sensitive.

3. How can I make the comparison case-insensitive?

Use the UPPER or LOWER function to normalize the case of the strings before applying EXACT.

4. What is the return value of the EXACT function?

It returns a Boolean value: TRUE if the texts match exactly, otherwise FALSE.

5. Can EXACT handle null values?

Yes, but the comparison involving null values will return FALSE.