Notes – Power Query in Power BI
What is Power Query?
Power Query is a data transformation tool in Power BI.
It helps you clean, reshape, and prepare data before using it for analysis or visualization.
It works in a no-code/low-code environmentโperfect for beginners.
Where is Power Query Used?
Power Query is available in:
- Power BI Desktop
- Excel
- Microsoft Dataflows (in Power BI Service)
In Power BI, it opens when you click โTransform Dataโ.
Key Features of Power Query
| Feature | Description |
|---|---|
| Step-by-step editor | Each action (like renaming, removing columns) is saved as a step |
| No coding needed | Built with a graphical interface โ drag, drop, and click |
| Supports M language | Behind the scenes, it uses a powerful formula language called M |
| Reusable queries | You can reuse query steps in multiple reports or tables |
| Connects to many sources | Excel, CSV, Web, SQL Server, SharePoint, APIs, etc. |
Common Tasks in Power Query
- Remove columns or rows
- Rename columns
- Change data types
- Filter and sort data
- Merge or append tables
- Replace values
- Pivot and unpivot data
Power Query Workflow
- Connect to the data source
- Transform the data using available options
- Load the cleaned data into Power BI model
This is often called ETL:
Extract โ Transform โ Load
Real-World Example
You import a messy Excel file with:
- Blank rows
- Unnecessary columns
- Wrong column names
Using Power Query, you:
- Remove blanks
- Rename columns
- Filter relevant data
Now the data is clean and ready to use for reporting.
Power Query Interface Overview
| Section | Purpose |
|---|---|
| Navigator Pane | Shows all queries and steps |
| Data Preview Grid | Displays sample data from selected table |
| Ribbon Toolbar | Contains transformation options |
| Applied Steps | Lists each action taken on the data |
