0
0
Power-biHow-ToBeginner ยท 3 min read

How to Create Calculated Column in Power BI: Step-by-Step Guide

To create a calculated column in Power BI, go to the Data view, select your table, then click New Column on the ribbon. Write a DAX formula to define the column calculation, and Power BI will add it to your table as a new column.
๐Ÿ“

Syntax

The basic syntax to create a calculated column in Power BI is:

  • ColumnName = DAX_Expression

Here, ColumnName is the name you give to the new column, and DAX_Expression is the formula that calculates the column's values.

Calculated columns are added to tables and calculated row by row.

DAX
NewColumn = [ExistingColumn] + 10
๐Ÿ’ป

Example

This example creates a calculated column that adds 10 to the values in an existing column called Amount in the Sales table. It demonstrates how to add a simple calculation to each row.

DAX
Sales[SalesPlusTen] = Sales[Amount] + 10
Output
If Sales[Amount] is 100, SalesPlusTen will be 110 for that row.
โš ๏ธ

Common Pitfalls

Common mistakes when creating calculated columns include:

  • Using measures instead of columns inside the formula, which causes errors.
  • Forgetting that calculated columns are row-based, so aggregate functions like SUM don't work as expected.
  • Creating calculated columns on very large tables can slow down your report.

Always check that your formula references columns, not measures, and test with sample data.

DAX
Wrong: NewColumn = SUM(Sales[Amount]) + 10
Right: NewColumn = Sales[Amount] + 10
๐Ÿ“Š

Quick Reference

StepAction
1Go to Data view in Power BI Desktop
2Select the table where you want the new column
3Click 'New Column' on the ribbon
4Enter your DAX formula for the calculated column
5Press Enter to create the column
โœ…

Key Takeaways

Calculated columns are created using DAX formulas and added row by row to tables.
Always use column references inside calculated column formulas, not measures.
Create calculated columns in Data view by clicking 'New Column' and writing your formula.
Test your formulas with sample data to avoid common errors.
Calculated columns can impact performance on large datasets, so use them wisely.