Create-First-Import-Query-as-Connection-Only How To Query A Query In Power Query

Today I was using power query to import external data in a CSV file and then do some transformations on the data. I decided I wanted to import my data as a connection only first then perform the transformations in a separate query.

My-Sales-Data-Connection-Only-Query How To Query A Query In Power Query

I had My Sales Data connection only query ready to use in another query. I hadn’t really noticed before, but there’s actually no command in the ribbon to get data from a query. I could have loaded my first query to a table and then queried that table, but I wanted to keep the first query as a connection only so using the From Table/Range command was not possible.

Get-Data-Menu-in-the-Get-and-Transform-Section-of-the-Data-Tab How To Query A Query In Power Query

I diligently searched all the commands in the Get Data menu from the Get & Transform Data section of the Data tab in the ribbon, but could not find a From Query command.

Get-Data-from-Other-Sources-Create-a-Blank-Query How To Query A Query In Power Query

It turns out, the way to query a query is to create a Blank Query and then reference your query as a source.

  1. Press the Get Data button found in the Get & Transform Data section of the Data tab.
  2. Select From Other Sources in the menu.
  3. Select Blank Query in the menu.

Add-Query-Reference-to-the-Query-Editor-Formula-Bar How To Query A Query In Power Query

After creating a blank query, the query editor will open and appear blank. We can now add our My Sales Data connection only query as the source data for our blank query. Do this by typing =#”My Sales Data” into the query editor formula bar and pressing Enter.

Query-of-a-Query-in-the-Query-Editor How To Query A Query In Power Query

A preview of the data from My Sales Data will load into the query editor and you can then begin your transformations as you wish.