TGViewer
Power BI & Tableau Resources Power BI & Tableau Resources @powerbi_analyst ยท 55.9K subscribers
Post #2143 296
๐Ÿ“Š Power BI Learning Roadmap โ€” Part 4

Topic 8: Conditional Columns, Custom Columns & Group By

Now that you know the basic Power Query transformations, it's time to learn how to create new information from existing data.

Three particularly useful features are:

โ€ข Conditional Columns

โ€ข Custom Columns

โ€ข Group By

These are different from simply cleaning existing data because you're now creating or summarizing information.

1. Conditional Columns

A Conditional Column creates a new column based on rules.

Think of it as:



"If this condition is true, return this value; otherwise, return something else."



Example: Sales Category

Suppose you have:

Product Sales

Laptop 80,000

Monitor 25,000

Keyboard 5,000

You could create a new column called Sales Category.

Your business rule might be:

Sales >= 50,000 โ†’ High

Sales >= 20,000 โ†’ Medium

Otherwise โ†’ Low

The result becomes:

Product Sales Sales Category

Laptop 80,000 High

Monitor 25,000 Medium

Keyboard 5,000 Low

This is useful when you want to classify existing data into meaningful business categories.

Other examples

You could classify:

Customer value

Sales >= 100,000 โ†’ Premium

Sales >= 50,000 โ†’ Regular

Otherwise โ†’ Basic

Transaction status

Amount > 100,000 โ†’ High Value

Otherwise โ†’ Standard

Age group

Age < 25 โ†’ Young

Age 25โ€“40 โ†’ Adult

Age > 40 โ†’ Senior

The important thing is that the rules should come from a meaningful business requirement rather than being created randomly.

2. Custom Columns

A Custom Column allows you to create a new column using an expression written in M, Power Query's language.

For example, suppose you have:

Quantity

Price

You could create:

Sales Amount = Quantity ร— Price

In Power Query, the expression could be:

[Quantity] * [Price]

The result might be:

Quantity Price Sales Amount

2 40,000 80,000

1 25,000 25,000

5 1,000 5,000

This is different from a DAX measure.

The calculation happens during the data transformation stage, before the data is loaded into the model.

3. Conditional Column vs Custom Column

This distinction is important.

Conditional Column

Best when your logic is based on straightforward conditions.

Example:

If Sales > 50,000

Then "High"

Else "Low"

Custom Column

Useful when you need more flexible expressions.

For example:

[Quantity] * [Price]

or more complex M expressions.

A simple way to remember it:

Conditional Column = Rule-based classification

Custom Column = Expression-based transformation

4. Group By

Group By is used to summarize rows based on one or more columns.

Suppose your data contains:

Region Product Sales

West Laptop 80,000

West Monitor 25,000

South Laptop 60,000

South Monitor 30,000

West Laptop 40,000

You might want total sales by region.

Group By can produce:

Region Total Sales

West 145,000

South 90,000

Instead of working with every individual transaction, you're creating a summarized dataset.

โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”

What can Group By calculate?

Depending on the requirement, you can calculate things such as:

โ€ข Sum

โ€ข Average

โ€ข Minimum

โ€ข Maximum

โ€ข Count rows

โ€ข Count distinct values

For example:

Total sales by region

West โ†’ โ‚น145,000

South โ†’ โ‚น90,000

Average sales by region

West โ†’ โ‚น48,333

South โ†’ โ‚น45,000

Number of transactions by region

West โ†’ 3

South โ†’ 2

5. Group By Multiple Columns
More from @powerbi_analyst
  1. Oct 8, 2026You aren't limited to grouping by one column. Suppose you want sales by: Region + Productโ€ฆ
  2. Oct 8, 2026๐ŸŽ“ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐˜€! ๐Ÿš€๐Ÿ”ฅ Upgrโ€ฆ
  3. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  4. Oct 7, 2026๐Ÿ”น Power Query Doesn't Usually Change the Original Source Suppose your source is: Sales.xlโ€ฆ
  5. Oct 7, 2026๐Ÿ“Š Power BI Learning Roadmap โ€” Part 4 Topic 6: Power Query Power Query is one of the mostโ€ฆ
  6. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
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 โ†’