Courseiva
Prepare the data →easyMultiple Choice

Combine Files in Power Query

You are importing data from a folder containing multiple CSV files with the same structure. You want to combine all files into a single table, but only include files that have been modified in the last 7 days. What Power Query transformation should you use?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Filter the folder contents by 'Date Modified' before combining

Option B is correct because Power Query's Folder data source exposes file metadata columns such as Date modified, and applying a filter on that column before invoking the Combine Files transformation restricts the combined table to only files modified within the last 7 days. This keeps the import efficient and ensures the resulting single table contains only the desired recent files. Option A is wrong because 'Sample File' merely defines the file structure and does not filter by modification date. Option C is wrong because 'Merge Queries' joins two existing queries on matching keys, not folder file metadata. Option D is wrong because filtering after combining would still load all files first, and the Date modified column is not retained in the combined result.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use 'Sample File' and manually filter

    Why it's wrong here

    The 'Sample File' option in Power Query is used only to infer the schema/structure of the files before combining; it does not perform any row-level filtering. Manually filtering after using the sample file would require loading all file contents first, which defeats the purpose of reducing data volume upfront. The sample file is a static template for structure, not a dynamic filter, so it cannot selectively include files based on metadata like 'Date Modified'.

  • ✓

    Filter the folder contents by 'Date Modified' before combining

    Why this is correct

    Filtering the folder contents by 'Date Modified' before combining is correct because the folder query in Power Query contains metadata (including 'Date Modified') for each file before any binary content is read. By filtering this file-list table, you prune the set of files that the 'Combine Files' transformation will process, so only recent files are expanded and loaded. This is an efficient streaming-like approach that minimizes data extraction and refresh time.

  • ✗

    Use 'Merge Queries' with the folder

    Why it's wrong here

    The 'Merge Queries' operation is designed to join two tables side-by-side based on matching key columns, not to append row sets from multiple files. The folder data source returns a table of file metadata, not the content of the CSV files themselves, so merging the folder with another query would not concatenate or combine the individual CSV data. To combine multiple files, you must use an append-style operation like 'Combine Files', not a merge.

  • ✗

    Combine files using 'Combine & Load', then filter by date modified

    Why it's wrong here

    'Combine & Load' immediately reads and expands the binary content of every file in the folder, then loads the entire dataset before you can filter by 'Date Modified'. This approach is inefficient because it forces Power Query to process and materialize all rows from all files, even those you don't need, increasing memory usage and refresh duration. Filtering within the combined table afterward is not the same as filtering the folder listing; it happens too late to avoid the processing cost.

About these practice questions

Courseiva writes every PL-300 question from scratch — 524 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

4 more ways this is tested on PL-300

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. You are importing data from a folder containing multiple CSV files with identical structure. You use the 'Combine files' transform in Power Query. Which TWO statements are true about this process?

easy
  • A.The sample file is automatically selected as the first file in alphabetical order.
  • B.Only the sample file is imported; other files are ignored.
  • C.The combine process uses Power Automate to merge files.
  • ✓ D.Power Query creates a function that applies the same transformations to each file.
  • ✓ E.Power Query creates a sample file query that serves as a template for all files.

Why D: Option D is correct because when you use the 'Combine files' transform in Power Query, it generates a reusable function (typically named 'Transform File' or similar) that encapsulates the transformations applied to the sample file, and then invokes that function for every other file in the folder so each file undergoes the same steps. Option E is correct because Power Query creates a separate sample file query (often named 'Sample File' or 'Transform Sample File') that acts as a template, defining the schema and transformation logic that the function applies to all files. Option A is not correct because the sample file is not automatically chosen by alphabetical order; Power Query typically selects the first file it encounters (often based on the folder's file listing order) and lets the user pick a different sample file if needed. Option B is not correct because all files in the folder are combined, not just the sample file. Option C is not correct because the combine process is handled entirely within Power Query's M engine, not by Power Automate.

Variation 2. You are importing data from a folder containing multiple CSV files with identical structure. You want to automatically combine all files into one table in Power Query. Which connector should you use?

easy
  • A.Excel Workbook connector
  • B.CSV connector
  • C.Web connector
  • ✓ D.Folder connector

Why D: The Folder connector is the correct choice because it is specifically designed to connect to a folder containing multiple files, and when combined with the 'Combine Files' transformation in Power Query, it automatically merges all CSV files with identical structures into a single table. This connector handles the iterative process of reading each file and appending rows without manual scripting.

Variation 3. You are loading data from a folder containing multiple Excel files with identical structure. Some files have inconsistent column names due to manual edits. You need to ensure that all data is loaded correctly without errors. What should you do in Power Query?

medium
  • ✓ A.Use the 'Combine Files' feature with a sample file, then in the transformation step, promote headers and rename columns using a mapping table.
  • B.Use 'Merge Queries' to join the files based on row position.
  • C.Change the data source to a SharePoint folder and use 'Load to Data Model' directly.
  • D.In Power Query, use 'Enter Data' to manually create the schema.

Why A: The 'Combine Files' feature in Power Query uses a sample file to infer the schema, and then you can apply transformations like promoting headers and renaming columns using a mapping table to handle inconsistent column names across files. This ensures all data loads without errors by standardizing the column names before combining.

Variation 4. You need to prepare data from a folder containing multiple CSV files with identical structure. What is the most efficient way to load all files into a single table?

easy
  • A.Import each CSV file separately and then append them
  • ✓ B.Use the 'From Folder' data source and then click 'Combine & Transform Data'
  • C.Write a Python script in Power Query to read and combine files
  • D.Use a dataflow to connect to the folder and apply the 'Combine Files' transformation

Why B: The 'From Folder' data source in Power Query automatically detects multiple CSV files with identical structure and provides a 'Combine & Transform Data' button that merges them into a single table in one step. This is the most efficient method as it eliminates the need for manual imports or scripting, leveraging Power Query's built-in file combination logic.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PL-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PL-300 exam.