6.7 Query Dependencies
Start with a problem
Shahrukh wants to delete a query called Raw_Pune that seems unused. Two other queries would break.
Explain simply
View › Query Dependencies draws a map: sources, then queries, then loaded tables. Check it before deleting or renaming.
Show the data
| Query | Depends on | Loaded to model? |
|---|---|---|
| Raw_Pune | pq_raw_pune_export.csv | No (Enable load off) |
| Orders | Raw_Pune | Yes |
| Stores | Orders | Yes |
About this data: This table uses columns: Query, Depends on, Loaded to model?. This table uses columns: Box, Arrow to. This table uses columns: Wrong result, Reason, Correction. Values shown are the lesson examples already on this page (not a new dataset).
Fictional sample data. Practice file: pq_raw_pune_export.csv (source: src/practice/).
Demonstrate
- Rename the 6.1 query
Raw_Pune; makeOrdersa Reference of it (cleaning steps in Orders). - Right-click Raw_Pune › untick Enable load (name turns italic).
-
View › Query Dependencies.
Your result should look like this:
Diagram CSV file, then Raw_Pune, then Orders, then Stores -
Click Raw_Pune in the diagram: Orders and Stores highlight.
Show the result
Your result should look like this (fictional sample):
| Box | Arrow to |
|---|---|
| pq_raw_pune_export.csv | Raw_Pune |
| Raw_Pune | Orders |
| Orders | Stores |
Explain what happened
The diagram shows every query that would fail if Raw_Pune were removed.
Explore further
- Group queries: right-click › Move To Group › Staging, Dimensions, Facts.
Detailed reference for this lesson:
Large projects have many queries: source queries, staging queries, helper functions, parameters (बदलता येणारे मूल्य, जे अनेक ठिकाणी वापरता येते) and final tables. View › Query Dependencies shows a diagram of how they connect.
Steps in Power BI
- In the Power Query Editor click View › Query Dependencies.
- The diagram shows data sources (files, folders, databases) on the left, then queries, then the tables loaded to the model.
- Select a query to highlight everything it depends on and everything that depends on it.
- Use the layout options and zoom at the bottom of the window to read large diagrams.
Worked example. In our project, the diagram shows: Folder (Blinkit files) → Blinkit_Orders; AmazonNow_Orders.csv → AmazonNow_Orders; both → Orders (loaded); Products.xlsx → Product; and the parameter FolderPath feeding the folder source.
Organise the Queries pane: right-click a query › Move To Group › New Group… and create groups such as Parameters, Staging, Dimensions, Facts, Functions.
Tip
Queries shown in italics in the Queries pane have Enable load turned off – they run but are not loaded into the model.
Ravindra Bagale's Tip
Friends, many students delete a "staging" query that looks unused, and three other queries fail. Check View › Query Dependencies before deleting or renaming any query or parameter. It shows exactly which queries depend on it. This matters for both exams and interviews.
Ravindra Bagale's Tip – मराठी
मित्रांनो, बरेच students न वापरलेली वाटणारी "staging" query delete करतात, आणि इतर तीन queries fail होतात. कोणतीही query किंवा parameter delete किंवा rename करण्याआधी View › Query Dependencies चेक करा. त्यावर कोणत्या queries अवलंबून आहेत ते नेमकं दिसतं. हे exam आणि interview दोन्हीसाठी important आहे.
Ravindra Bagale's Tip – हिंदी
दोस्तों, बहुत से students बेकार लगने वाली "staging" query delete कर देते हैं, और तीन दूसरी queries fail हो जाती हैं. कोई भी query या parameter delete या rename करने से पहले View › Query Dependencies देखो. उसमें साफ़ दिखता है कि कौन सी queries उस पर निर्भर हैं. यह exam और interview दोनों के लिए ज़रूरी है.
Fix common mistakes
| Wrong result | Reason | Correction |
|---|---|---|
| Two queries fail after delete | Did not check dependencies | Check the diagram first |
| Raw_Pune appears in the model | Enable load still on | Untick Enable load |
| Diagram unreadable | Many queries | Use zoom and layout options |
Practise independently
Practice task
If you delete Orders, which query also fails?
Hints
- Who uses Orders?
Solution
Stores.
Think like a professional
Checking dependencies before changes is basic change management.
Revision card