Curriculum
Calculated Columns are one of the most important features of DAX and Power BI. Calculated Columns allow users to create new columns in a table by applying formulas and business logic to existing data. These columns become part of the data model and can be used in reports, visualizations, filters, slicers, and dashboard calculations.
Organizations use Calculated Columns to categorize customers, calculate profit margins, generate business classifications, create custom attributes, and enrich datasets for advanced analytics and reporting.
Calculated Columns are widely used in:
Understanding Calculated Columns is essential because they help transform raw business data into meaningful information that supports reporting and decision-making.
Calculated Columns are columns created using DAX formulas that perform row-by-row calculations on existing data.
Unlike imported columns, Calculated Columns do not come directly from the source data. Instead, they are generated within Power BI using business rules and formulas.
Calculated Columns can be used to:
These columns become a permanent part of the Power BI data model.
Raw data often lacks the specific information needed for analysis.
Calculated Columns help:
Benefits include:
Calculated Columns are frequently used in professional Power BI projects.
Calculated Columns calculate values for every row in a table.
Example Sales Table:
| Revenue | Profit |
|---|---|
| 100000 | 20000 |
| 50000 | 10000 |
Calculated Column:
Profit Margin
Formula:
Profit / Revenue
Result:
| Revenue | Profit | Profit Margin |
|---|---|---|
| 100000 | 20000 | 0.20 |
| 50000 | 10000 | 0.20 |
Applications:
Financial analytics.
Steps:
Open:
Data View
Select a table.
Click:
New Column
Enter a DAX formula.
Press Enter.
Applications:
Data enrichment.
General syntax:
Column Name = Formula
Example:
Profit Margin =
Sales[Profit] /
Sales[Revenue]
Applications:
Business calculations.
Calculated Columns use Row Context.
This means Power BI evaluates each row individually.
Example:
Profit Margin =
Sales[Profit] /
Sales[Revenue]
For every row:
Current Row Revenue
Current Row Profit
Applications:
Row-level calculations.
Example:
Profit Margin =
DIVIDE(
Sales[Profit],
Sales[Revenue]
)
Benefits:
Safer calculations.
Applications:
Financial reporting.
Organizations often classify customers.
Example:
Customer Category =
IF(
Sales[Revenue] > 100000,
"Premium",
"Standard"
)
Applications:
Customer analytics.
Customer segmentation.
Example:
Sales Category =
IF(
Sales[Revenue] >= 50000,
"High Sales",
"Low Sales"
)
Applications:
Business intelligence.
Example:
Customer Tier =
IF(
Sales[Revenue] > 100000,
"Gold",
IF(
Sales[Revenue] > 50000,
"Silver",
"Bronze"
)
)
Applications:
Loyalty programs.
Customer segmentation.
Example:
Full Name =
Customers[First Name]
&
" "
&
Customers[Last Name]
Applications:
Customer reporting.
Example:
Order Year =
YEAR(
Sales[Order Date]
)
Applications:
Time analysis.
Example:
Month Name =
FORMAT(
Sales[Order Date],
"MMMM"
)
Applications:
Dashboard reporting.
Example:
Age Group =
IF(
Customers[Age] >= 18 &&
Customers[Age] <= 30,
"Young Adult",
"Adult"
)
Applications:
Customer analytics.
Example:
Customer Code =
CONCATENATE(
"CUST-",
Customers[Customer ID]
)
Applications:
Business reporting.
SWITCH simplifies multiple conditions.
Example:
Performance Rating =
SWITCH(
TRUE(),
Sales[Revenue] > 100000,
"Excellent",
Sales[Revenue] > 50000,
"Good",
"Average"
)
Applications:
Performance evaluation.
| Feature | Calculated Columns | Measures |
|---|---|---|
| Stored in Model | Yes | No |
| Uses Row Context | Yes | No |
| Dynamic | No | Yes |
| Increases Model Size | Yes | No |
| Used in Filters | Yes | Limited |
Understanding this difference is critical for Power BI development.
Calculated Columns provide:
Applications:
Business intelligence.
A typical Calculated Columns workflow includes:
Import Data
↓
Identify Business Requirement
↓
Create DAX Formula
↓
Generate Calculated Column
↓
Validate Results
↓
Use in Reports
This workflow is commonly used in Power BI projects.
Data Analysts use Calculated Columns for:
Benefits:
Better business insights.
Business Analysts use Calculated Columns for:
Benefits:
Improved decision-making.
A retail company wants to classify customers based on annual spending.
Using Calculated Columns, customers are grouped into:
These categories are then used in dashboards and reports.
Applications:
Customer analytics.
May increase model size.
Can reduce performance.
May create calculation errors.
Can affect reporting accuracy.
Avoiding these mistakes improves Power BI performance.
Improve readability.
Ensure accuracy.
Improve performance.
Reduce model size.
Improve maintenance.
These practices support professional Power BI development.
Benefits include:
Calculated Columns are an essential component of advanced Power BI solutions.
After completing this lesson, you will be able to:
Calculated Columns are columns created using DAX formulas within Power BI.
They help enrich data and create business-specific calculations.
Yes. Calculated Columns evaluate formulas row by row.
Yes. They can be used in slicers, filters, and visualizations.
Calculated Columns are stored in the model, while Measures are calculated dynamically.
When row-level calculations or business classifications are required.
Calculated Columns help organize, classify, and enrich data for reporting and analytics.
Calculated Columns enable advanced business logic and help create more meaningful reports and dashboards.
Want to master Python, SQL, Power BI, and Data Analytics?
WhatsApp us