TGViewer
Data Analytics Data Analytics @sqlspecialist · 111K subscribers
Post #3117 2.3K
🚀 Data Analyst Roadmap — Part 23

📊 Power BI Level 2 — Power Query: Data Cleaning & Transformation

Power Query is used in Power BI to clean, transform, and prepare data before building reports.

🔹 1. Open Power Query

In Power BI Desktop:

Home → Transform Data

This opens the Power Query Editor.

You will mainly work with:

• Queries

• Data Preview

• Applied Steps

🔹 2. Change Data Types

Always check whether columns have the correct data type.

For example:

Customer_ID → Text

Quantity → Whole Number

Sales → Decimal Number

Order_Date → Date

Incorrect data types can cause problems in calculations and visuals.

🔹 3. Remove Unnecessary Columns

If your dataset contains columns you don't need, remove them.

For example:

Customer_ID

Customer_Name

Email

Phone

Sales

Internal_Code

If your analysis only needs Customer ID, Customer Name, and Sales, remove the rest.

🔹 4. Filter Unnecessary Rows

Power Query can remove or filter:

• Blank rows

• Invalid records

• Test data

• Unwanted categories

• Records outside the required period

Always understand the business rule before removing data.

🔹 5. Remove Duplicates

Power Query allows you to remove duplicate values based on selected columns.

For example, if "Customer_ID" should be unique in a Customer table, duplicate IDs should be investigated.

But don't remove duplicates blindly.

A Sales table can naturally contain many rows for the same customer.

🔹 6. Handle Missing Values

You may find:

Blank

NULL

N/A

Unknown

Depending on the situation, you can:

• Keep the value blank

• Replace it

• Remove the record

Don't automatically replace blanks with zero.

For example, a blank discount doesn't always mean a discount of 0.

🔹 7. Clean Text

Data often contains unwanted spaces or inconsistent formatting.

Example:

" Mumbai"

"Mumbai "

"MUMBAI"

Useful Power Query transformations include:

Trim → Removes unnecessary spaces

Clean → Removes unwanted non-printable characters

You can also change text to:

• UPPERCASE

• lowercase

• Proper Case

🔹 8. Replace Values

Suppose your data contains:

Mum

Mumbai

MUMBAI

You can replace and standardize values so they are represented consistently.

This is especially useful for:

• City

• Region

• Category

• Department

• Status

🔹 9. Split Columns

Suppose you have:

Full Name

John Smith

Sarah Johnson

You can split it into:

First Name | Last Name

John | Smith

Sarah | Johnson

You can split a column using delimiters such as:

• Space

• Comma

• Dash

• Custom delimiter

🔹 10. Extract Text

You can extract specific parts of a text column.

For example:

john@gmail.com

You could extract:

john

or:

gmail.com

Power Query provides options such as:

• Text Before Delimiter

• Text After Delimiter

• Text Between Delimiters

• First Characters

• Last Characters

🔹 11. Conditional Column

You can create categories based on conditions.

For example:

Sales >= 50,000 → High

Sales >= 20,000 → Medium

Otherwise → Low

This is similar to "CASE WHEN" in SQL.

🔹 12. Custom Column

Power Query also allows you to create calculated columns.

For example:

Total Amount = Quantity × Unit Price

Custom columns use Power Query's formula language, called M.
  • ❤ 4
More from @sqlspecialist
  1. Oct 4, 20269️⃣ How would you calculate month-over-month growth? Sample Answer: “I would first retriev…
  2. Oct 4, 2026📊 Data Analyst Interview Series — Part 3 Guys, let's continue our Data Analyst Interview…
  3. Sep 29, 2026🔟 How would you find duplicate records in SQL? Sample Answer: "I would first identify the…
  4. Sep 29, 2026📊 Data Analyst Interview Series — Part 2 Guys, let's continue our Data Analyst Interview…
  5. Sep 29, 2026𝗙𝗥𝗘𝗘 𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀 𝗧𝗼 𝗟𝗲𝗮𝗿𝗻 𝗔𝗜 𝗶𝗻 𝟮𝟬𝟮𝟲🚀 ​ Explore 6 free resource…
  6. Sep 29, 2026"After identifying duplicates, I investigate whether they are genuine duplicate records or…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →