Please note javascript is required for full website functionality.

Blog

Power Pivot Principles: The A to Z of DAX Functions – CONTAINSSTRINGEXACT

19 July 2022

 

In our long-established Power Pivot Principles articles, we continue our series on the A to Z of Data Analysis eXpression (DAX) functions.  This week, we look at CONTAINSSTRINGEXACT.

 

The CONTAINSSTRINGEXACT function

Similar to CONTAINSSTRING, this function returns the value TRUE or FALSE, depending upon whether one text string is contained within another.  The difference between the two functions is that this one is case sensitive.

The CONTAINSSTRINGEXACT function employs the following syntax to operate:

CONTAINSSTRINGEXACT(within text, find text)

  • within text: this is required.  This represents the text in which you wish to search for find text
  • find text: also required, this represents the text sought.

If find text is indeed a substring of within text and matches case, then TRUE is returned; otherwise, FALSE results.

It should be further noted that:

  • CONTAINSSTRINGEXACT is case sensitive.

The following DAX query

EVALUATE
    ROW(
        "Case 1", CONTAINSSTRINGEXACT("abcd", "bc"),
        "Case 2", CONTAINSSTRINGEXACT("abcd", "BC"),
        "Case 3", CONTAINSSTRINGEXACT("abcd", "a*d"),
        "Case 4", CONTAINSSTRINGEXACT("abcd", "ef")
    )

will provide the following results:

Case 1 Case 2 Case 3 Case 4
TRUE FALSE FALSE FALSE


Come back next week for our next post on Power Pivot in the Blog section. In the meantime, please remember we have training in Power Pivot which you can find out more about here. If you wish to catch up on past articles in the meantime, you can find all of our Past Power Pivot blogs here.

Newsletter