[Power Query] Difference Between “Transform Sample File” and “Other Queries”

目次

Introduction

When importing data using Power Query in Excel, you will often see “Transform Sample File” and “Other Queries” displayed in the sidebar of the Query Editor.

While both seem to involve data transformation, their purposes and roles are completely different.

In this article, I have summarized the differences between these two based on my research.

What is “Transform Sample File”?

Purpose

The “Transform Sample File” is a template used to apply a common transformation process to multiple files within a folder.

It is suitable for cases where a single folder contains multiple Excel or CSV files with the exact same structure.

This function works by creating a transformation process for a single file chosen as a “sample” and then applying that same process to all other files in the folder.

How to Use

  1. Select “Get Data” > “From File” > “From Folder”.
  2. Power Query automatically selects one sample file and creates the “Transform Sample File” query (often found inside a “Helper Queries” folder).
  3. Any data transformation steps applied to this query are automatically applied to all files within the folder.

What are “Other Queries”?

Purpose

“Other Queries” is the area that lists all standard queries created in Power Query.

This includes all queries unrelated to folder combining, such as single Excel tables, Web data, or database connections.

It also displays intermediate processes that reference other queries, as well as the final aggregated results (the output of the folder combination).

How to Use

  • All queries created via standard import methods (from Excel tables, CSV files, SQL Server, etc.) appear here.
  • You have high freedom to analyze, process, and join data here, such as merging or appending other queries.
  • Independent transformations are possible without relying on the “Transform Sample File” logic.

Difference Between Transform Sample File and Other Queries

FeatureTransform Sample FileOther Queries
Main UseTemplate for applying common logic to multiple files in a folderDisplaying all standard queries and intermediate processes in the workbook
Creation TimingAutomatically generated when loading files from a folderDisplayed for all user-created queries, regardless of type
TargetSample file (one representative file)Single files, tables, reference queries, etc.
RelationshipThe source template reflected in the final “Combined” queryCan be merged with or referenced by other queries as needed

Summary

When handling data in Power Query, “Transform Sample File” and “Other Queries” have the following clear differences:

  • Transform Sample File: A template query for applying common transformation logic to multiple files.
  • Other Queries: A list of all standard queries created within the workbook.

To utilize Power Query efficiently, it is important to understand these differences and use them appropriately.

I hope this article helps you in your Power Query journey.

Thank you for reading to the end.

よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!

この記事を書いた人

私が勉強したこと、実践したこと、してることを書いているブログです。
主に資産運用について書いていたのですが、
最近はプログラミングに興味があるので、今はそればっかりです。

目次