Clean, transform, and load data in Power BI
Apply query transformations
-
First, apply transformations to the Product query.
-
Remove the RetailPrice, Photo, and Sales columns.
-
Change the data type of the Channels column to Whole Number.
-
Rename the following columns:
-
ProductSKU to SKU
-
ProductName to Product
-
ProductCategory to Category
-
ItemGroup to Item Group
-
KitType to Kit Type
-
-
Second, apply transformations to the Sales query.
-
Remove all columns, except:
-
OrderDate
-
ProductID
-
Quantity
-
UnitPrice
-
-
Change the data type of the UnitPrice column to Fixed Decimal Number.
-
Rename the UnitPrice column to Unit Price.
-
Multi-select the Quantity and Unit Price columns, and then add a new column based on their multiplication.
-
Rename the new column as Sales.
Integrate queries
-
Create a new query using the Excel connector, connecting to the D:\Allfiles\Demo\Data\ProductCost.xlsx file.
-
Remove the Product column.
-
Change the data type of the ProductCost column to Fixed Decimal Number.
-
Select the Product query, and then merge with the ProductCost query, relating the SKU columns.
-
In the Privacy Levels window, set the privacy level for the D:\ to Organizational.
-
Expand the ProductCost column to include the ProductCost column (from the ProductCost query).
-
Rename the new column as Cost.
Disable and load queries to the data model
-
In the Queries pane, disable the ProductCost query.
-
On the Home ribbon tab, click the Close & Apply icon.
-
In Power BI Desktop, point out the two tables in the Data pane.
-
Save the Power BI Desktop file.
-
Leave the Power BI Desktop file open for the next demo.