Create a Simple Empty Table in Power Query with Code Example

Just copy and paste this into a blank query and you will get a simple two column table with two rows.

me@jaykilleen.com wrote this almost 7 years ago and it was last updated almost 7 years ago.


← Back to the Posts

Sometimes you just need a simple empty table in Power Query where you can throw in some values. I use this pattern for recording parameters that I want to send down to the Excel worksheet or if I want to create the table and then append other tables to the blank table.

This first example is the fastest and most concise.

let 
  Source = Table.FromRecords(
    {  
      [Name = 1, Value = "3"],  
      [Name = 2, Value = "4"] 
    }
  )
in
  Source

This example uses the #table but is messy and annoys my brain.

let
  Source = #table(
    {
      "Name",   // First Column Field Name
      "Value"   // Second Column Field Name
    }, 
    {
      {
        1,2     // First Row Field Values
      },
      {
        3,4     // Second Row Field Values
      }
    }
  )
in
  Source

But the second option comes in handy if you want a table with headers only and no rows. Great for appending to other tables that have the values.

let
  Source = #table(
    {
      "Name",   // First Column Field Name
      "Value"   // Second Column Field Name
    },
    {}
  )
in
  Source

Similar