Forum Discussion

ChainSpart's avatar
ChainSpart
Frequent Visitor
5 years ago
Solved

Text.Contains with underscore

Hi there,

 

I'm working with the Power Query editor right now.

I have a table connected to my database, and I need to apply a parameter in my request to get some values, else I get an error of query (this is ok).

 

So I've created a text type parameter which help me to get values in my table.

but when this parameter contains an underscore, the request fails, as if the underscore split my parameter.

 

Is there any way to include the underscore in the parameter to have my good results please ?

 

Here is 2 examples : 

- WORKS :  Table.SelectRows(dbo_AnalogHistory, each Text.Contains([TagName], "AAA.BBB.CC"))

- FAILS :  Table.SelectRows(dbo_AnalogHistory, each Text.Contains([TagName], AAA_BBB_CC))

 

Thanks.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ChainSpart 

    What kind of database are your trying to connect to? 

    Can your parameter without any symbol like"A","B" or with other symbols like dot succeed to filter your table?

    Will you get any message when you use the parameters with underscore?

    If it is possible, you can show me the screenshot about your issue and show me your M code in Advance Editor.

     

    Best Regards,

    Rico Zhou

     

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