Forum Discussion

Jack007's avatar
Jack007
Frequent Visitor
2 years ago
Solved

Check if Column contains string with iterator?

I need to verify if a column has certain strings in it. Currently, I am using the code If(containstring(columnname, "X"), "desired", "none"). However, the list of values for X is very large. Is the...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Jack007 ,

     

    Power BI Dax does not support iterate operations on the data.

    However, you can use the M language to filter specific strings for this purpose.

    I created a simple sample:

      

    First, you can create a parameter for your specific string like this:

      

    Then use this M script:

    = Table.SelectRows(each Text.Contains([Large Value], #"Check X")) 

     

    Result shown below:

     

    Perhaps this will work, and if you have any questions, please provide me with more information to make sure we can better solve the problem for you!

     

    An attachment for your reference. Hope it helps.

     

    Best regards,


    Community Support Team_ Scott Chang

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.