Share via

After appending a group of queries, how can I add a custom column to show the queries(sources)?

Gray, Jenn B. (SCD) 0 Reputation points
2026-03-10T15:12:41.93+00:00

I have 10 queries and have combined them. Now I'd like to add a column to identify the query source.

Windows for business | Windows 365 Business
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. HLBui 4,180 Reputation points Independent Advisor
    2026-03-12T07:32:44.1733333+00:00

    Good day Gray, Jenn B. (SCD)

    Just checking to see how is everything. Please feel free to let me know if you need any assistance

    0 comments No comments

  2. HLBui 4,180 Reputation points Independent Advisor
    2026-03-10T16:08:30.6933333+00:00

    Good day Gray, Jenn B. (SCD)

    When you append multiple queries in Power Query, the system doesn’t automatically tag the rows with their original source, so you’ll need to add that yourself. The usual trick is: before you append, go into each query and add a Custom Column with a hardcoded label (like "Source = Query1", "Source = Query2", etc.). That way, when you combine them, each row already carries its “badge” showing where it came from. Another option is to use the Query Name dynamically with = "QueryName" typed in the custom column, but most folks just type in a descriptive string that makes sense for them.

    Please try these step:

    Open each of your 10 queries.

    Add a custom column with a text value that identifies the query (e.g., "Sales_2024").

    Append them all together.

    You’ll now see a “Source” column in the combined table that tells you exactly which query each row originated from.

    It’s a bit manual upfront, but it pays off later when you’re troubleshooting or analyzing across sources. Think of it like putting name tags on everyone before they walk into the same room. Makes life easier

    If you find this helpful, Kindly mark “Accept Answer” so others know it worked for you and it’ll make my day too!

    0 comments No comments

  3. Q&A Assist
    2026-03-10T15:12:52.8233333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Use Power Query’s custom column feature and hard‑code the source name in each query before appending.

    For each of the 10 queries (before the Append step):

    1. Open the query in Power Query Editor.
    2. On the Add column tab, select Custom column.
    3. In New column name, enter something like SourceQuery.
    4. In Custom column formula, enter a text literal with that query’s name, for example:
         = "Query1"
      
    5. Select OK.

    Repeat for each query, changing the text (for example, "Query2", "Query3", etc.).

    Then perform the Append of all 10 queries. The resulting appended table will include the SourceQuery column, showing which original query (source) each row came from.

    If the custom column needs to use existing fields (for example, combining with other identifiers), use the same Custom column dialog and reference columns in the formula, such as:

    = [ExistingColumn] & " - " & "Query1"
    

    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.