Forum Discussion

BIanon's avatar
BIanon
Helper V
2 years ago
Solved

Dynamic query params with multi select (Cannot convert a value of type List to type Text)

Hello Community, I am working with a Direct Query model where I allow the end user to select some values in slicers and pass these slicers to a query as a query param. I have one param with num...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi BIanon 

    Based on your description, you can refer to the following link about multiple selections in dynamic paramaters.

    https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters#bind-the-fields-to-the-parameters

    You can try to add a new paramater in advanced editor.

    e.g 

    let 
       selextedvalue=if Type.Is(Value.Type(BrandParameter2), List.Type) then  
                Text.Combine({"'",Text.Combine(BrandParameter2,"','"),"'"}) else 
        Text.Combine({"'",BrandParameter2,"'"})
    in
    .......

    Best Regards!

    Yolo Zhu

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