BBampaa

Lessons › Power BI

Power BI lesson

Measures or columns?

Price belongs to each sale, so it's a column: you could put it on an axis or in a slicer. Total Revenue is one number for whatever is selected, so it's a measure.

Try this lesson free →
About 5–10 minutes · no sign-up needed

The idea

A calculated column is worked out once for every row and stored in the table. A measure is worked out when it's shown, for whatever is filtered:

Key points

Calculated columnRow by row, stored in the table. Use it to slice, filter or group by.
MeasureOne answer for whatever is filtered. Use it for totals, averages and ratios.
The testNeed it on an axis or in a slicer? Column. Need a number that changes with filters? Measure.

It's one of the most common Power BI interview questions. When in doubt, prefer a measure: it doesn't make the file bigger.

In Power BI Desktop

Table tools, then New column, for a calculated column. Home, then New measure, for a measure.

Practice

Try each one in your head first, then open the answer.

1. Build a calculated column for each sale's price per item.
Price = Sales[Revenue] / Sales[Qty]
2. Build a calculated column that says TRUE when a sale has 8 or more items.
Bulk Order = Sales[Qty] >= 8
3. Write a calculated column for each sale's revenue with VAT added. VAT is 7.5%.
Revenue with VAT = Sales[Revenue] * 1.075
4. Write a calculated column that says TRUE when the sale's revenue is over 100.
Big Order = Sales[Revenue] > 100
5. Write a calculated column that says TRUE when the sale is from the Lagos store.
Lagos Sale = Sales[Store] = "Lagos"

Learn it by doing. This lesson is a short hands-on level on Bampaa: see it work, then build and write it yourself, with instant feedback.

Try this lesson free →
About 5–10 minutes · no sign-up needed