Introduction to Power Query Week 2
Introduction to Power Query Week 2
Automation
There Automate the laborious getting and cleaning data tasks.
Time Saving
Reduce time-consuming tasks that can take hours, down to a fraction of the
time, sometimes as little as a few seconds.
Query Editor
In Power BI, a query editor is part of the Power Query feature. Power Query is used to connect, transform,
and load data into Power BI. The query editor in Power BI allows users to shape and transform data before it
gets loaded into the Power BI model. Users can perform various data manipulations, such as filtering,
merging, and cleaning, using a graphical interface. It's a crucial component for preparing and refining data for
analysis in Power BI reports and dashboards.
Power BI —How to Access Power Query Editor
Data transformation is the process of preparing raw data for analysis. In Power BI, it involves cleaning,
sorting, aggregating, merging, and formatting data using the Power Query Editor. This ensures data accuracy
and consistency for effective analysis and reporting.
Power BI —C ommon Data Task for Power Query
https://learn.microsoft.com/en-us/power-bi/transform-model/
Power BI —Data Types
1 2
*(For more detail of each data type, refer to the link below)
https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-data-types
Power BI —Basic Row Transformations
Power BI —Basic C olumn Transformations
Power BI —Basic Built-in Transformation Functions
Power BI —Add C olumns
Power BI —Filter Data
1
Power BI —Transforming Text (Replace Values)
*(To replace null values, in Replace Value → Value To Find, type “null”)
1
2
Power BI —Transforming Text (Split C olumn)
3
Power BI —Transforming Text (Extract)
3
Power BI —Pivot |Unpivot |Transpose
3. When apply Transpose, the row become column and vice versa
*(Unlike pivot and unpivot, transpose doesn’t recognize unique values, instead
entire table is transformed so that each row becomes a column and vice versa)
Power BI —Pivot |Unpivot |Transpose
Power BI —Pivot |Unpivot |Transpose
Power BI —Pivot |Unpivot |Transpose
1. Select all the columns which you want to Unpivot column means to unpack the similar values and group them
pivot under a single heading.
2. Right click on any of the column name, When we look at our unsorted data, we see that all the 5 columns show
the same metric(Sales). Therefore we want to separate it into two
select Unpivot Columns. It will result in columns where one column will show City and the other Sale.
two columns, Attribute and Value.
2
Power BI —Pivot |Unpivot |Transpose
3
Power BI —Pivot |Unpivot |Transpose
1. Select all the columns which you want to fill Fill is required sometimes, especially when getting data from excel and we a un-
structed table. Then we can apply pivot or un-pivot transformations on it, which
without fill wont work.
2. Navigate to Transform and select Fill, then Down *(If the are empty spaces in the columns, we first have to replace them with null,
since fill only nulls, “ ” blank space is still consider a value in text)
1
Power BI —C onditional C olumn
2. With if else conditions, defined the output we for our new column.
Power BI —Custom C olumn
The Queries pane in Power BI's Power Query Editor displays applied data transformation steps, allowing
users to view, reorder, and modify these steps. It provides insights into the sequence of actions applied to
shape and clean the data.
Power BI —Query Pane O ptions
3
Power BI —Advance Editor