Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Calculated Columns vs. Measures | Writing DAX Measures
Excel Data Modeling

Calculated Columns vs. Measures

Swipe to show menu

DAX offers two types of calculations inside Power Pivot: measures, which live in the calculation area, and calculated columns, which live inside a table. Both use DAX syntax and both are stored in the data model rather than in the Excel workbook.

The Calculated Column Example

Let's build a Price Band column that assigns each product a label — Low, Mid, or High — based on its unit price. This is a row-level label: every product has its own price band determined by its own unit price.

= IF(Products[Unit Price] < 100, "Low", IF(Products[Unit Price] < 500, "Mid", "High"))

Key Points:

  • No measure name or := — calculated columns start with = like an Excel formula. The column name is set by renaming the header after the formula is entered;
  • Column reference syntaxProducts[Unit Price] — the same table and column syntax used in DAX measures. No cell addresses;
  • Two closing brackets — one bracket closes the inner IF, one closes the outer. A common source of formula errors.
Note
Note

DAX does not have an IFS function — only IF. When more than two outcomes are needed, IF functions must be nested, with each false branch leading into the next condition.

Task

Step 1 — Add two calculated columns

  1. Open the workbook. Go to Power Pivot → Manage → Data View;

  2. Calculated column 1 — Order Size (Sales table);

  3. Click the Sales tab. Add a calculated column at the far right of the table using the following formula:

    = IF(Sales[Quantity] >= 4, "Large", "Small")

  4. Rename the column Order Size;

  5. Scroll through the column and confirm that rows with Quantity of 4 or more show Large and rows with Quantity of 3 or fewer show Small;

  6. Calculated column 2 — Customer Tier (Customers table);

  7. Click the Customers tab. Add a calculated column using the following formula:

    = IF(Customers[Segment] = "Enterprise", "Tier 1", IF(Customers[Segment] = "SMB", "Tier 2", "Tier 3"))

  8. Rename the column Customer Tier;

  9. Scroll through the column and confirm that Enterprise customers show Tier 1, SMB customers show Tier 2, and Startup customers show Tier 3.

question mark

Which of the following is the most accurate statement about the storage and performance implications of calculated columns versus measures?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 4. Chapter 3

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Section 4. Chapter 3
some-alt