Search code examples
powerbidaxpowerbi-desktop

Containsstring in dax cannot search the string


I have a table in which I want to do a count of rows but the formula is not working. I have tried wildcards too. Not sure what am I doing wrong.

The card displays BLANK

Asset Rows = 
COUNTROWS(
    FILTER(
        'GL Account Group - GLACGRP', 
        CONTAINSSTRING('GL Account Group - GLACGRP'[Account Group Name], "assets")
        )
)

The data is as follows: enter image description here


Solution

  • Your code is correct. Trim the column 3 and check. May be some extra spaces causing error.