Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi - is there a way to specific which query opens when you select Transform Data from the menu bar? I've tried changing it and saving, renaming it to "01-queryname" and I can't get it to work.
Thanks in advance~
Solved! Go to Solution.
Hi @Shure846 , Thank you for reaching out to the Microsoft Community Forum.
The file is auto opening on Hormel because your target query is part of an active dependency chain (you show Source = Table.Combine({Hormel, #"Not Hormel"}) and several Table.NestedJoin steps).
Make a truly independent landing query. Either create a topmost Landing query with no references or duplicate the Sales history query and inline the actual source steps from Hormel and Not Hormel into the duplicate (rename those local blocks and set Source = Table.Combine({Source_Hormel, Source_NotHormel})) so the duplicate has no incoming arrows in View -> Query Dependencies. Save the PBIX, fully close Power BI and reopen, the editor will then open to that independent query.
Hi,
As far as I know, there is no way to set a default query for Transform data.
In your case Sales history depends on Hormel and Not Hormel, so Power Query opens the first query in that chain (Hormel).
A simple workaround is to create a new query that just references Sales history and move it to the top of the Queries list, or right-click Sales history in the Fields pane and choose Edit query to open it directly.
Hi @Shure846 , Hope you're doing okay! May we know if it worked for you, or are you still experiencing difficulties? Let us know — your feedback can really help others in the same situation.
Hi,
As far as I know, there is no way to set a default query for Transform data.
In your case Sales history depends on Hormel and Not Hormel, so Power Query opens the first query in that chain (Hormel).
A simple workaround is to create a new query that just references Sales history and move it to the top of the Queries list, or right-click Sales history in the Fields pane and choose Edit query to open it directly.
Hi @Shure846 , Hope you're doing fine. Can you confirm if the problem is solved or still persists? Sharing your details will help others in the community.
Hi - the issue still persists. Here is the Advanced Query code:
let
Source = Table.Combine({Hormel, #"Not Hormel"}),
#"Filtered Rows" = Table.SelectRows(Source, each ([EDAYEAR] <> "#(001A)")),
#"Merged Queries" = Table.NestedJoin(#"Filtered Rows", {"HEADQUARTERSNBR"}, #"Member HQ", {"Member #"}, "Member HQ", JoinKind.LeftOuter),
#"Expanded Member HQ" = Table.ExpandTableColumn(#"Merged Queries", "Member HQ", {"Member city", "Member state", "Member ZIP", "Legacy member", "Member name fixed", "Smithfield NESP", "Regional"}, {"Member city", "Member state", "Member ZIP", "Legacy member", "Member name fixed", "Smithfield NESP", "Regional"}),
#"Added Custom" = Table.AddColumn(#"Expanded Member HQ", "Brand owner", each if [BRAND]="Packer Label" then "Packer" else "UniPro"),
#"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"Brand owner", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"EDAYEAR", "Year"}, {"EDAMNTH", "Month"}, {"HEADQUARTERSNBR", "Member #"}, {"DEPTCODE", "Department #"}, {"DEPTNAME", "Department name"}, {"BRAND", "Brand"}, {"Category Family Name", "Family Name"}, {"Category Line Name", "Line Name"}, {"Category Category Name", "Category Name"}, {"Category Group Name", "Group Name"}, {"PRODUCTUPC", "UPC"}, {"GTIN_DESCRIPTION", "Description"}, {"EDA_CY", "EDA"}, {"SPA_CY", "SPA"}, {"PURCH_ALL_CY", "COGS"}, {"CASES_ALL_CY", "Cases"}, {"LBS_ALL_CY", "Tonnage"}, {"Kosher", "Is Kosher"}, {"Is Halal Certified", "Is Halal"}, {"Status", "Partners Plus Status"}, {"Level", "Partners Plus Level"}, {"Rancher's Legacy", "Rancher's Legacy item"}, {"Season", "Conference Season"}, {"Attended?", "Conference attendee"}}),
#"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"HEADQUARTERSNAME", "Member Name"}),
#"Renamed Columns1" = Table.RenameColumns(#"Removed Columns",{{"Member name fixed", "Member Name"}, {"Department name", "Department Name"}, {"Rancher's Legacy item", "Rancher's Legacy Item"}, {"Conference attendee", "Conference Attendee"}, {"Member city", "Member City"}, {"Member state", "Member State"}, {"Legacy member", "Legacy Member"}, {"Brand owner", "Brand Owner"}}),
#"Reordered Columns" = Table.ReorderColumns(#"Renamed Columns1",{"Year", "Month", "Supplier Number", "Supplier Name", "Member #", "Member Name", "Member Status", "Department #", "Department Name", "Region Name", "GTIN", "Brand", "Family Name", "Line Name", "Category Name", "Group Name", "UPC", "Description", "EDA", "SPA", "COGS", "Cases", "Tonnage", "Storage State", "Is Halal", "Is Kosher", "Partners Plus Status", "Partners Plus Level", "EB Item Available", "Rancher's Legacy Item", "Conference Season", "Conference Attendee", "Member City", "Member State", "Member ZIP", "Legacy Member", "Brand Owner"}),
#"Inserted Addition" = Table.AddColumn(#"Reordered Columns", "EDA+SPA", each [EDA] + [SPA], type number),
#"Changed Type1" = Table.TransformColumnTypes(#"Inserted Addition",{{"Year", Int64.Type}, {"Month", Int64.Type}}),
#"Inserted Merged Column" = Table.AddColumn(#"Changed Type1", "Supplier # & Name", each Text.Combine({[Supplier Number], [Supplier Name]}, "-"), type text),
#"Changed Type2" = Table.TransformColumnTypes(#"Inserted Merged Column",{{"Supplier Number", Int64.Type}}),
#"Merged Queries1" = Table.NestedJoin(#"Changed Type2", {"Supplier Number"}, #"Integrated vendors", {"Number"}, "Integrated vendors", JoinKind.LeftOuter),
#"Expanded Integrated vendors" = Table.ExpandTableColumn(#"Merged Queries1", "Integrated vendors", {"Main vendor"}, {"Main vendor"}),
#"Renamed Columns2" = Table.RenameColumns(#"Expanded Integrated vendors",{{"Main vendor", "Main Supplier"}}),
#"Replaced Value" = Table.ReplaceValue(#"Renamed Columns2",null,"N/A",Replacer.ReplaceValue,{"Main Supplier"}),
#"Renamed Columns3" = Table.RenameColumns(#"Replaced Value",{{"Normalized", "Normalized name"}}),
#"Capitalized Each Word" = Table.TransformColumns(#"Renamed Columns3",{{"Normalized name", Text.Proper, type text}}),
#"Renamed Columns4" = Table.RenameColumns(#"Capitalized Each Word",{{"Normalized name", "Normalized Supplier Name"}}),
#"Replaced Value1" = Table.ReplaceValue(#"Renamed Columns4","Unknown","Unk",Replacer.ReplaceText,{"Description"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1",null,"Not Provided",Replacer.ReplaceValue,{"Storage State"}),
#"Inserted Merged Column1" = Table.AddColumn(#"Replaced Value2", "Member name & number", each Text.Combine({Text.From([#"Member #"], "en-US"), [Member Name]}, "-"), type text),
#"Added Custom1" = Table.AddColumn(#"Inserted Merged Column1", "Month name", each Date.MonthName([Date])),
#"Changed Type3" = Table.TransformColumnTypes(#"Added Custom1",{{"Month name", type text}}),
#"Filtered Rows1" = Table.SelectRows(#"Changed Type3", each [#"Member #"] <> -1),
#"Reordered Columns1" = Table.ReorderColumns(#"Filtered Rows1",{"Year", "Month", "Month name", "Supplier Number", "Supplier Name", "Member #", "Member Name", "Member Status", "Department #", "Department Name", "Region Name", "GTIN", "Brand", "Family Name", "Line Name", "Category Name", "Group Name", "UPC", "Description", "EDA", "SPA", "COGS", "MDM Pack Size", "Manufacturer", "Mfr Product #", "Cases", "Tonnage", "Normalized Supplier Name", "Storage State", "Is Halal", "Is Kosher", "Category", "Partners Plus Status", "Partners Plus Level", "EB Item Available", "Date", "Rancher's Legacy Item", "Conference Season", "Conference Attendee", "Member City", "Member State", "Member ZIP", "Legacy Member", "Brand Owner", "EDA+SPA", "Supplier # & Name", "Main Supplier", "Member name & number"}),
#"Renamed Columns5" = Table.RenameColumns(#"Reordered Columns1",{{"Month", "Month #"}}),
// NEW: normalize & convert whitespace-only to null across all text columns
#"Fix Whitespace-To-Null" =
let
CleanNull = (s as nullable text) as nullable text =>
let
s1 = if s = null then null else Text.Replace(s, Character.FromNumber(160), " "), // NBSP -> space
s2 = if s1 = null then null else Text.Clean(s1),
s3 = if s2 = null then null else Text.Trim(s2)
in
if s3 = null or s3 = "" then null else s3,
Prev = #"Renamed Columns5",
// Get text columns by sampling the first row (safe for mixed types)
SampleRow = try Prev{0} otherwise null,
TextCols =
if SampleRow = null then {}
else List.Select(Table.ColumnNames(Prev),
(c) => Type.Is(Value.Type(Record.Field(SampleRow, c)), type text)),
Result = Table.TransformColumns(Prev, List.Transform(TextCols, each {_, CleanNull, type text}))
in
Result,
#"Merged Queries2" = Table.NestedJoin(#"Fix Whitespace-To-Null", {"Department Name"}, #"Dept binning", {"Department name"}, "Dept binning", JoinKind.LeftOuter),
#"Expanded Dept binning" = Table.ExpandTableColumn(#"Merged Queries2", "Dept binning", {"Dept Bin"}, {"Dept Bin"})
in
#"Expanded Dept binning"
Hi @Shure846 , Thank you for reaching out to the Microsoft Community Forum.
The file is auto opening on Hormel because your target query is part of an active dependency chain (you show Source = Table.Combine({Hormel, #"Not Hormel"}) and several Table.NestedJoin steps).
Make a truly independent landing query. Either create a topmost Landing query with no references or duplicate the Sales history query and inline the actual source steps from Hormel and Not Hormel into the duplicate (rename those local blocks and set Source = Table.Combine({Source_Hormel, Source_NotHormel})) so the duplicate has no incoming arrows in View -> Query Dependencies. Save the PBIX, fully close Power BI and reopen, the editor will then open to that independent query.
Hi @Shure846 , hope you are doing great. May we know if your issue is solved or if you are still experiencing difficulties. Please share the details as it will help the community, especially others with similar issues.
Hi @Shure846 , Thank you for reaching out to the Microsoft Community Forum.
When you click Transform Data, Power BI does not let you manually choose a default query. The editor always opens to the top most query in the Queries pane but only when the Power Query Editor is completely closed. If the editor was already open in the background, Power BI simply brings that window forward and shows whatever query you last clicked inside it. This is why some users think it remembers the last active query, while others see it jump to the first query in the list, both are true depending on whether the editor was open or closed.
So, the only reliable way to control what opens is to move your preferred query to the very top of the list, including above any hidden queries. Open Power Query, enable Show Hidden Queries, drag your chosen query to the top, then Close & Apply and save the PBIX. The next time you open Power Query (with the editor closed), it will always land on that first query. Unfortunately, there is no separate setting or naming trick that forces a default query beyond this behaviour.
Hi - I did exactly that and exited PowerBI. I came back to the file and it went straight to the highlighted query. It wasn't the last query that I was viewing prior to exit, so I'm not sure what I could be doing wrong here. I want it to go to "Sales history", but I cannot get it to move away from "Hormel" when I open the file.
Hi @Shure846 , Thank you for reaching out to the Microsoft Community Forum.
Power BI always opens the editor to the first expanded query it sees. In your screenshot, the first open folder is Sales history and its first item is Hormel, so the editor goes there every time. Collapse that folder (and any others above it), save and reopen. Once the folder is collapsed, Power BI will stop drilling into it and it will open at the top query or group instead, letting Sales history be the one that appears first.
I did those exact steps, exited PBI and reopened into Power Query and it went straight back to all folders expanded and the Hormel query.
Hi @Shure846 , Thank you for reaching out to the Microsoft Community Forum.
From your screenshots, I can see that Power BI isn’t opening on Hormel because of anything you’re doing wrong, it’s because the Sales history group is a dependent query chain and Power BI automatically expands groups like that every time the file opens. When a group contains queries that reference each other, Power Query treats it as active, rebuilds the chain on load and expands the folder so you can see all the dependent steps. Once that folder is expanded, the first query inside it becomes the default landing point, which is why it keeps snapping back to Hormel even after you collapse and save it.
If you want Power Query to open somewhere else, you’ll need to move Sales history (or a small landing query) into its own independent group at the very top. Independent groups don’t auto-expand on load, so Power BI won’t drill into them and you’ll get consistent control over which query opens first.
I believe I tried that (screenshot below), no change in behavior.
Hi @Shure846 , Thank you for reaching out to the Microsoft Community Forum.
Create a true standalone landing query at the very top that has no references (Home -> Transform data -> New Source -> Blank Query, set the formula to = "Start here"), name it Landing and make sure it isn’t a reference of any other query. Drag that Landing query to the top, save the PBIX, close Power BI completely and then reopen. Because it has no dependencies, Power Query will not auto expand it and the editor will open there.
If you can’t add a standalone query for design reasons, move the entire dependent Sales history group below the Landing group (drag the group down so it’s not the first expanded block), save and close, then reopen.
Didn't work, same behavior as prior. Upon opening PQ it went straight to Hormel and started the preview process.
Hi @Shure846 , Thank you for reaching out to the Microsoft Community Forum.
Right click your Sales history -> Duplicate (not Reference). Move that duplicated query into the top Landing group, rename it, confirm its formula is self contained (a true independent query) and optionally turn off its load if you don’t want it in the model. Save, close Power BI completely, then reopen, Power Query should land on that independent duplicate because it isn’t part of the dependent chain that auto expands.
If that still doesn’t work, paste the duplicated query’s Advanced Editor code here as plain text and a tiny sample table along with relevant details. So, I can check for any remaining references and repro it to see it succeds.
Would having query merges cause this behavior in PowerQuery?
Hi @Shure846 , Thank you for reaching out to the Microsoft Community Forum.
Yes, merges, appends or any step that references another query make that query part of a dependency chain and Power Query auto expands dependency chains on file open. That auto expand is what forces the editor to land on the first child even if you put a Landing item above it. So, the landing item must be completely independent, no Table.NestedJoin, no Table.Combine, no steps that use another query name and no references.
Hi @Shure846,
So the answer is No you cannot manually set a default query to open in the Power Query Editor
When you click Transform Data the Power Query Editor opens and automatically selects the query based on a simple rule (It selects the first query in the list in alphabetical (A to Z) order)
But your approach is correct but you might need to refine it:
But here is a Simple trick you could Do If you dont want to rename your queries: (Advanced Editor)
That doesn't work.
Hi @Shure846,
Unfortunately, Power BI Desktop does not currently allow you to set a default query that opens automatically when you click Transform Data. By design, this button always opens the Power Query Editor showing the last query you were working on in that session.
If your question is about heavy load.
If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.
Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |