Forum Discussion

adamb123's avatar
adamb123
Regular Visitor
2 years ago
Solved

Expression.Error: 3 arguments were passed to a function which expects between 1 and 2.

Hi,   I am getting this unspecific error on my syntax in Advanced Editor in Power Query. I edited filter directly in Advanced Editor (I want to filter file path based on the current date) and I got...
  • AlienSx's avatar
    2 years ago

    Hi, adamb123 Text.Combine expects as list of text values like Text.Combine({"text1", "text2"}) while your code is like Text.Combine({"text1"}, {"text2"}, {"text3"})

     

  • jennratten's avatar
    2 years ago

    Hello - it's the Text.Combine statement.  It accepts a list of text to be combined and an optional delimiter character as text, which would be 1 or 2 arguments. Sometimes it helps to break up the script with indentions.

     

    Text.Combine(texts as list, optional separator as nullable text) as text

     

     

    Here is the explaination of your actual script....the same comments apply to the second Text.Combine statement.

     

    If you want to filter the rows for results that include a particular date within a text column, you can do it like this, which saves the current date to a variable and then selects rows which contain the date in that format.  You can modify the date variable to meet your needs, or if you can provide an example of what your dates look like and an example of what you are trying to filter for, I'll be happy to help some more.  Pls let me know if you have any questions.

        #"Filtered Rows" = Table.SelectRows(
            #"Added Custom", 
                let CurrentDate = Date.ToText ( Date.From ( DateTime.FixedLocalNow() ), "yyyyMMdd" ) in
                each Text.Contains([Custom], CurrentDate)
        )