Power BI Lesson 10 – Basic Transformations | Dataplexa
Beginner Level · Lesson 10

Basic Transformations

Raw data from any source — a CSV export, a database table, a shared Excel file — almost never arrives clean. Before you build a single visual you need to shape it: remove the junk, fix the structure, and make every column mean exactly one thing. This lesson covers every everyday transformation you will use in Power Query Editor.

The Raw Dataset We Will Clean

Throughout this lesson we will use a single sales export that has all the classic real-world problems. Every transformation below fixes a specific issue in this table.

Power Query Editor — orders_raw.csv (before cleaning)
🔤 Column1 🔤 order date 🔤 REGION 🔤 product name 🔤 revenue 🔤 qty 🔤 Status
← This row is a header row from the source, not data. Needs to be removed.
100105/01/2024 North Laptop Pro$1,2002shipped
100207/01/2024southMonitor 27"$3501DELIVERED
100105/01/2024 North Laptop Pro$1,2002shipped
nullnullnullnullnullnullnull
100309/01/2024NORTHKeyboard$855Processing
100412/01/2024EastLaptop Pro$1,2001Shipped
⚠ Column names are wrong (Column1, lowercase, inconsistent casing) ⚠ Revenue is Text not Number ($1,200) ⚠ Duplicate row (OrderID 1001 appears twice) ⚠ Blank row with all nulls ⚠ Region and Status have inconsistent casing (North, NORTH, north) ⚠ Leading/trailing spaces in Region

Step 1 — Use First Row as Headers

Sometimes Power BI reads the first row of data as a header row and names columns "Column1", "Column2" etc. This happens with CSV files that have no clear column name row, or when the data starts with a blank row. You fix it in one click.

1
In Power Query Editor, go to Home → Use First Row as Headers. Power BI promotes the values in row 1 to become the column names and removes that row from the data.
2
If the opposite problem occurs — column names ended up in the data as a row — use Home → Use Headers as First Row to demote them back, then delete that row and re-promote correctly.

Step 2 — Rename Columns

Column names in raw data are often inconsistent — lowercase, uppercase, with spaces, with special characters. Clean names make your DAX easier to write and your Data pane easier to read. The rule is simple: PascalCase, no spaces, descriptive but short.

Before — raw column names
Column1
order date
REGION
product name
revenue
qty
Status
After — clean column names
OrderID
OrderDate
Region
ProductName
Revenue
Quantity
Status

To rename a column, double-click the column header in Power Query Editor and type the new name. Or right-click the header and choose Rename. Each rename adds a "Renamed Columns" step to Applied Steps.

Step 3 — Remove Blank Rows

Exported files commonly contain blank rows between data sections, at the bottom after a total row, or at the top before the headers. These blank rows load as null-filled rows in your model and distort row counts and aggregations.

Remove all blank rows
Go to Home → Remove Rows → Remove Blank Rows. This removes any row where every cell is null. It is safe to apply to any dataset — if a row has at least one value, it is kept.
Remove top N rows
Go to Home → Remove Rows → Remove Top Rows and enter a number. Use this when your file has N rows of metadata or titles above the actual data that you need to skip.

Step 4 — Remove Duplicate Rows

Duplicates in a dataset cause every aggregation to be inflated. A revenue total double-counts orders that appear twice. Always check for duplicates before loading — especially in data that has been manually assembled or exported from a system that allows re-submissions.

1
Remove all duplicate rows — select all columns (Ctrl+A on the headers) then Home → Remove Rows → Remove Duplicates. Keeps the first occurrence of each unique combination and removes all others.
2
Remove duplicates based on one column — click a single column header (e.g. OrderID) then Home → Remove Rows → Remove Duplicates. Removes rows where OrderID repeats, regardless of what the other columns contain. Use this to deduplicate by a unique key.
Before and after removing duplicates on OrderID
Before (6 rows — 1 duplicate)
OrderIDRegionRevenue
1001North$1,200
1001North$1,200
1002South$350
1003North$85
1004East$1,200
After (5 rows — duplicate removed)
OrderIDRegionRevenue
1001North$1,200
1002South$350
1003North$85
1004East$1,200

Step 5 — Filter Rows

Filtering in Power Query Editor removes rows permanently from the query — unlike a report-level filter which just hides them. Use this when you genuinely do not need certain rows in your model at all, such as cancelled orders, test records, or data from years outside your analysis window.

Filter dropdown — Status column
Filter by value
Text Filters
Equals...
Does Not Equal...
Contains...
Does Not Contain...
Begins With...
Ends With...
OK
Cancel

Click the dropdown arrow on any column header to open the filter menu. Uncheck values to exclude them, or use Text Filters / Number Filters / Date Filters for condition-based filtering like "greater than $500" or "after 2023-01-01".

Step 6 — Remove Columns

Only load the columns your report actually needs. Every extra column increases model size, slows refresh, and clutters the Data pane. There are two approaches — remove the columns you do not want, or choose the columns you do want and remove all others.

Remove Columns
Select the columns you want to remove (hold Ctrl to select multiple), then right-click → Remove Columns. The selected columns are deleted from the query. All other columns remain.
Good when: you only need to drop a few specific columns
Remove Other Columns
Select the columns you want to keep, then right-click → Remove Other Columns. Everything except your selection is deleted. This is safer when the source adds new columns over time — you lock down exactly what loads.
Good when: you want to lock down exactly which columns load

Step 7 — Trim and Clean Text

Text columns from exported files almost always carry invisible baggage — leading spaces, trailing spaces, and non-printable characters embedded in the values. These cause silent failures: "North" and " North" look identical in a chart but group as two separate categories. A filter for "North" will miss " North" entirely.

Trim
Removes leading and trailing spaces from every value in the column. Does not touch spaces between words.
" North " → "North"
"North East" stays "North East"
Transform → Format → Trim
Clean
Removes non-printable characters — invisible characters that come from copy-pasting or certain database exports.
"North\u0000" → "North"
(invisible char removed)
Transform → Format → Clean
Best practice
Always apply both Trim and Clean to every text column from an external source. It takes two seconds and prevents grouping failures that are extremely hard to debug later.
Apply Trim → then Clean → on all text columns

Step 8 — Fix Inconsistent Casing

Our dataset has "North", "NORTH", and "north" all in the Region column. Power BI treats these as three different categories. A chart will show three separate bars for the same region. You fix this by standardising the case across the entire column.

Option What it does Example Best for
UPPERCASE All characters to uppercase "north" → "NORTH" Country codes, status codes, abbreviations
lowercase All characters to lowercase "NORTH" → "north" Email addresses, URL slugs
Capitalize Each Word First letter of each word capitalised "north east" → "North East" Region names, product names, person names

To apply: select the column → Transform → Format → UPPERCASE / lowercase / Capitalize Each Word.

Step 9 — Replace Values

Replace Values is Power Query's find-and-replace. You use it to fix specific known problems — a currency symbol preventing a type change, a legacy code that needs renaming, or a status value with inconsistent spelling.

Common Replace Values scenarios:

SCENARIO 1: Remove $ and commas so Revenue can become a number
  Column: Revenue
  Find: $        Replace with: (nothing — leave blank)
  Find: ,        Replace with: (nothing)
  Then: Change type to Decimal Number

SCENARIO 2: Standardise status values
  Column: Status
  Find: shipped    Replace with: Shipped
  Find: DELIVERED  Replace with: Delivered

SCENARIO 3: Replace null with a default
  Column: Region
  Find: null       Replace with: Unknown

SCENARIO 4: Fix a legacy product code rename
  Column: ProductCode
  Find: LPT-OLD   Replace with: LPT-2024

How to do it:
  Right-click column header → Replace Values
  OR: Transform → Replace Values in the ribbon
Revenue column before and after Replace Values + type change
Before (Text type — cannot SUM)
🔤$1,200
🔤$350
🔤$85
🔤$1,200
After (Decimal Number — SUM works)
1.21200.00
1.2350.00
1.285.00
1.21200.00

Step 10 — Reorder Columns

Column order in Power Query controls the order columns appear in the Data pane and in Data View. This does not affect your DAX calculations but it makes your model easier to navigate. Put key columns first — IDs, dates, and the main measure column — then descriptive text columns.

To reorder, simply drag column headers left or right in Power Query Editor. Or select a column and use Transform → Move → To Beginning / To End / Before / After.

The Full Cleaning Sequence in Applied Steps

After applying all ten steps above, the Applied Steps panel shows the full cleaning history of the query. Every step is a recorded instruction that Power BI replays in order on every refresh. If you spot a mistake in step 4, you can click that step, fix it, and all later steps re-run from there automatically.

Applied Steps — orders_raw.csv (after full cleaning)

  Source                    ← connects to the CSV file
  Promoted Headers          ← Use First Row as Headers
  Changed Type              ← auto-detected types (may be wrong)
  Renamed Columns           ← Column1→OrderID, order date→OrderDate, etc.
  Removed Blank Rows        ← deleted all-null rows
  Removed Duplicates        ← deduplicated on OrderID
  Filtered Rows             ← removed Status = Cancelled, Status = Test
  Removed Columns           ← dropped columns not needed
  Trimmed Text              ← stripped leading/trailing spaces from Region
  Replaced Value            ← removed $ from Revenue
  Replaced Value1           ← removed , from Revenue
  Changed Type1             ← set Revenue to Decimal Number
  Replaced Value2           ← standardised Status casing
  Capitalized Each Word     ← fixed Region casing
  Reordered Columns         ← moved key columns first

Total steps: 15
Every step runs automatically on each refresh.
Final clean table — ready to load into the model
123 OrderID 📅 OrderDate 🔤 Region 🔤 ProductName 1.2 Revenue 123 Quantity 🔤 Status
1001Jan 5, 2024NorthLaptop Pro$1,200.002Shipped
1002Jan 7, 2024SouthMonitor 27"$350.001Delivered
1003Jan 9, 2024NorthKeyboard$85.005Processing
1004Jan 12, 2024EastLaptop Pro$1,200.001Shipped
4 rows · all types correct · no duplicates · no blanks · consistent casing · Revenue ready to SUM

Teacher's Note: The order of your Applied Steps matters. If you try to change the type of Revenue to Decimal Number before you replace the $ and comma characters, every row will show Error. Always do Replace Values on a column to clean its content first, then change its type. A good mental checklist: clean the content → then declare the type. This sequence prevents almost every data type error you will encounter as a beginner.

Practice

Practice 1 of 3

To remove leading and trailing spaces from a text column in Power Query Editor, you use the Transform → Format → ___ option.

Practice 2 of 3

When you want to keep only specific columns and drop everything else — including any new columns the source might add in future — you right-click and choose Remove ___ Columns.

Practice 3 of 3

If a Revenue column contains values like "$1,200" and you want to change it to a numeric type, you must first use ___ Values to remove the $ and comma characters before changing the data type.

Lesson Quiz

Quiz 1 of 3

Your Region column has "North", "NORTH", and "north" all as separate values. A chart is showing three separate bars for the same region. What is the fastest fix in Power Query Editor?

Quiz 2 of 3

You load a table with 10 columns but only need 4 of them. You want to make sure that if the source ever adds new columns, they are NOT automatically loaded into your model. Which approach is correct?

Quiz 3 of 3

You change the type of the Amount column to Decimal Number but get errors on several rows. You investigate and find those rows contain the value "Pending" instead of a number. What is the correct fix?

Next up — Lesson 11 moves into Model View and shows you how to create relationships between your tables — what a relationship is, the difference between one-to-many and many-to-many, how to draw relationship lines correctly, and why getting your model structure right before building visuals makes everything else easier.