Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

List of integers as parameter

Hi, I got a dataset that is too big for import.   I would like to define a parameter that can be used in a query. The parameter should be a list of integers that will be used in the query. The inpu...
  • Anonymous's avatar
    Anonymous
    5 years ago

    For future reference, here is a solution. 

     

    1) Create a parameter of type text, name=ImoList. The user inputs a comma seperated list of integers "1000,2000,3000,...."

    2) Create a new query (MyList) with the following content

     

    let
        Source = Text.Split(ImoList,","),
        #"Out"=List.Transform(Source,each Number.FromText(_))
    in
        #"Out"

     

    3) Use the list for filtering

     

    #"Filtered Rows1" = Table.SelectRows(#"Renamed Columns", each (List.Contains(MyList,[imo])))