Forum Discussion

andy18's avatar
andy18
New Member
2 years ago
Solved

Using values from cells as parameters in Queries

Hi,   If you want to use excel cell values/named ranges as parameters through-out your queries, as filters, factors, parameters, etc. What is the best implementation for speed/efficiency, best prac...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi andy18 ,
    I understand your concern and everyone in this community is happy to help each other. You don't need to worry about an increase in views but 0 replies, because the people who view it may not be able to solve your problem, but eventually someone will reply.
    Here is my take on this.
    First parameter is in the query but used for other queries. This method is simple and straightforward and keeps everything in a single query making it more manageable. However, if you have a lot of parameters it can become less efficient as each query needs to reference the same named range over and over again. So, if you have a small number of parameters and want to keep your queries simple, use this method.
    Next, for each parameter one query. This approach is more modular and can improve performance, especially if you have many parameters. Each parameter is managed independently, which can make debugging easier. However, managing multiple queries can become cumbersome, especially if you have many parameters. So the best practice is to use this method if you have multiple parameters and need to optimize performance. It also helps to keep queries clear and modular.
    Finally, you can try using parameter tables.
    You can refer to the following documentation
    Building a Parameter Table for Power Query (excelguru.ca)
    Create a parameter query (Power Query) - Microsoft Support
    Power Query Parameters: 3 methods + 1 simple example (exceloffthegrid.com)
    Create A Parameter Table For Your Power Queries
    Excel Power Query Parameter from a Cell Value

    Best regards,
    Albert He

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