๐Ÿ”„ Power Query โ€“ Data Transformation in Power BI (with Example)

๐Ÿ“… Updated: June 2025
โœ๏ธ By TechTown.in
๐Ÿ” Keywords: Power Query, Data Transformation, Power BI, Load vs Transform, CSV to Table, ETL in Power BI, Power BI CSV Import

Sample file :


๐Ÿ”ฐ What is Power Query?

Power Query is Power BIโ€™s built-in data transformation engine. It allows you to take raw data from different sources โ€” like Excel, CSV, or databases โ€” and clean, shape, and prepare it for powerful visual analysis.

You donโ€™t need to be a coder or data scientist. With point-and-click tools, Power Query lets you:

  • Remove errors
  • Fix column types
  • Split/merge columns
  • Create calculated fields
  • Apply conditional logic
  • And much more!

Itโ€™s where ETL (Extract, Transform, Load) happens in Power BI.


๐Ÿ“ฅ Starting with Data Import โ€“ The Example CSV

Letโ€™s say we import a file called:
๐Ÿ“ techtown_sales_data_jan2025.csv

When loaded into Power BI Desktop, you first land in the Navigator screen (as shown in your image). This gives you a snapshot of the data and a choice:

๐ŸŸข Load

  • Loads the data as-is directly into Power BI.
  • No transformation โ€” just straight into the data model.
  • Useful if the dataset is already clean.

๐Ÿ› ๏ธ Transform Data

  • Opens the Power Query Editor.
  • Allows you to edit, clean, and reshape the data.
  • Best for real-world messy datasets.

โœ… Pro Tip: Always click on Transform Data if you’re unsure about data quality.


๐Ÿง  Understanding the Dataset

Hereโ€™s a quick look at the columns weโ€™re working with:

ColumnDescription
DateOrder date
OrderIDUnique order identifier
CustomerIDCustomer code
CustomerNameCustomer full name
ProductCategoryType of product
ProductNameSpecific product name
QuantityUnits purchased
UnitPricePrice per unit (โ‚น)
TotalSaleQuantity ร— UnitPrice
StoreRegionRegional store location

๐Ÿ”„ What is Data Transformation?

Data transformation means converting raw data into clean, structured, and meaningful data.

Using Power Query, here are some transformations you might perform:

โœ… Common Transformations:

TaskPower Query Feature
Remove unwanted columnsHome โ†’ Remove Columns
Fix data types (e.g. date/text)Transform โ†’ Data Type
Fill missing valuesTransform โ†’ Fill โ†’ Down/Up
Remove duplicatesHome โ†’ Remove Rows โ†’ Remove Duplicates
Add new calculationsAdd Column โ†’ Custom Column
Split full namesSplit Column โ†’ By Delimiter
Rename columnsRight-click โ†’ Rename
Combine columnsTransform โ†’ Merge Columns
Filter recordsFilter icon on column headers

๐Ÿ› ๏ธ Real-Life Example: Steps in Power Query

When we hit “Transform Data”, Power Query Editor opens. Hereโ€™s a sample transformation flow for this dataset:

  1. Promote Headers
    โžค Automatically uses first row as column headers
    Step: Promoted Headers
  2. Change Data Types
    โžค Make sure Date is Date, Quantity is Whole Number, UnitPrice is Decimal, etc.
    Step: Changed Type
  3. Add a Custom Column
    โžค Recalculate TotalSale = Quantity * UnitPrice if not already present
    Add Column โ†’ Custom Column โ†’ [Quantity] * [UnitPrice]
  4. Remove Unwanted Columns
    โžค Say you donโ€™t need CustomerID, you can remove it
    Home โ†’ Remove Columns
  5. Split Full Name (Optional)
    โžค CustomerName โ†’ Split Column โ†’ By Space โ†’ First Name, Last Name

๐Ÿ“Š Output: Cleaned & Ready Data

After transformation, your dataset is:

  • Structured
  • Properly typed
  • Filtered
  • Enriched with calculated fields

Then, click on Close & Apply to load this data into Power BIโ€™s Data Model โ€” ready for reports, visuals, and dashboards.


โš™๏ธ Load vs Transform โ€“ What Should You Choose?

OptionWhen to Use
LoadIf the data is already clean and formatted
TransformIf the data is messy, needs calculations, filters, cleanup

โœ… Best Practice: Always review in Power Query Editor โ€” even a clean CSV can have wrong data types or NULLs.


๐Ÿ”— Related Features in Power Query

FeatureUse Case
Column QualityVisual indicators of errors, nulls, valid values
Column DistributionFrequency charts of column values
Merge QueriesJoin data from two different sources
Append QueriesStack data from multiple files/tables
Group ByCreate summarized tables (e.g., total sale by region)
ParametersReusable dynamic values (like Date filters)

๐Ÿง  Power Tips for Beginners

  • Enable Column Profiling via the View tab to see column statistics
  • Use Remove Errors to clean broken rows
  • Always check data types before loading
  • Use Advanced Editor to view underlying M code for each step
  • Every transformation is recorded and repeatable โ€” ideal for automated reports

๐Ÿ“š Conclusion

Power Query isnโ€™t just a tool โ€” itโ€™s your first line of defense in building clean, trusted data models in Power BI.

With its no-code interface and powerful transformation capabilities, Power Query empowers analysts, students, and professionals to prepare data like a pro.

๐ŸŒŸ If you clean data well, your insights become powerful.
Begin every Power BI project in Power Query Editor โ€” and youโ€™re already 50% done!