Add Column

Power BI · Power Query (Data Transformation)

Theory

The Add Column tab creates new columns while keeping the originals. Custom Column lets you write an M expression such as [Qty] * [Price]. Conditional Column builds if-then-else logic through a form without writing code. Column From Examples lets you type the result you want for a few rows and Power Query infers the transformation. There are also ready-made options like Index Column, Duplicate Column, and Date or Text extractions such as Year or First Characters.

For example, a Conditional Column named Order Size can label each Sales row: if Amount >= 1500 then "Large", else if Amount >= 800 then "Medium", else "Small". Order 103 with ₹1,500 becomes Large and order 104 with ₹600 becomes Small. The result is a fixed column computed at refresh, so it can be used in slicers, legends and relationships.

Why we use it

Reports often need categories or derived fields that do not exist in the source. Creating them in Power Query keeps the logic in one place and makes the column available like any other.

When to use it

Use Add Column for row-level values that do not change with report filters, such as bands, flags or parsed text. If the value must react to slicers or aggregate across rows, write a DAX measure instead.

How it works

  1. Need a new derived column
  2. Is the logic a simple if/then rule? Yes: Use Conditional Column. No: Use Custom Column or Column From Examples.
  3. Define the rule and output values
  4. Check results across several rows
  5. New column loads with the table

Syntax

Add Column → Custom Column | Conditional Column | Column From Examples | Index Column

M:
Table.AddColumn(table as table, newColumnName as text, columnGenerator as function, optional columnType as type)
each if [Amount] >= 1500 then "Large" else if [Amount] >= 800 then "Medium" else "Small"

Example

#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Order Size",
    each if [Amount] >= 1500 then "Large"
         else if [Amount] >= 800 then "Medium"
         else "Small",
    type text)

Key points

Power BI topics

Power BI Introduction

Getting Data

Power Query (Data Transformation)

Data Modeling

DAX (Data Analysis Expressions)

Data Visualization

Dashboards & Reports

Power BI Service

Advanced Features

Projects & Case Studies

Interview & Certification

Advanced DAX & Time Intelligence

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Power BI Dashboards & DAX

Learn data visualization and interactive dashboards step-by-step. Click any topic in the sidebar to open it right here.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice DAX Online 250 business scenarios on a star schema — write a measure and compare your visual with the expected one. Start practising →
Section {{ sec.num }}

{{ sec.label }}

Power BI  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
On screen — where to click

{{ rich.ui.title }}

{{ u.text }}
  1. {{ st.n }}{{ st.text }}
{{ rich.ui.title }}
{{ u.text }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax / Where to find it
{{ current.syntax }}
Example
{{ current.example }}
What You'll Learn — click to check off
  • {{ pt.mark }} {{ pt.text }}

Share this topic