Search code examples
excelms-query

Excel create multiple MS Queries using one data connection between two sheets in the same workbook


In Excel 2021, what exactly is a "data connection", "query" and "domain source name"?

Let's say I have a Workbook "Manahil_Customer_Database.xlsm" in which I have a sheet "sht_Customer_Cities" that has a table "tbl_Customer_Cities". In a new sheet "sht_Report" I want to run two queries using one connection via MS Query. Now when I go through the MS Query route I get one Domain Name Source File "Manahil_Customer_Database.dsn" and one MS Query file "Customer_Countries_Cities.dqy" and one Connection file "Customer_Countries_Cities.odc".

However when I look at the "Queries & Connections" it says 0 Queries and 1 Connection named "Customer_Countries_Cities". I want to be able to establish a single Data Connection via MS Query from the "sht_Report" to the Workbook "Manahil_Customer_Database.xlsm" and than run multiple queries using the same connection.


Solution

  • Power Query is a MS tool that assists you on your ETL tasks. As read in a previous answer, it is based on M language.

    To be able to import / modify / connect your data, the command is: DATA / GET DATA and select your input

    Check this link for a quick introduction: https://learn.microsoft.com/en-us/power-query/power-query-what-is-power-query