Power BI · Lesson 4 of 7

DAX basics: measures & columns

Measures vs calculated columns, SUM, COUNTROWS, DIVIDE and simple ratios.

DAX (Data Analysis Expressions) is Power BI's formula language.

  • A measure is calculated when a visual needs it, for the current filters (slicers, rows of a table). Use measures for totals, averages and ratios — almost everything.
  • A calculated column is computed row by row when data loads and stored in the table. Use it only when you need a value per row to filter or group by, such as a price band.

Use DIVIDE(a, b) instead of a / b — it returns blank instead of an error when b is zero. Build small measures and reuse them in bigger ones.

Sample data & steps

Power BI Desktop (free, Windows)
Measures (Home → New measure):

Total Sales   = SUM ( Sales[Amount] )
Orders        = COUNTROWS ( Sales )
Avg Order     = DIVIDE ( [Total Sales], [Orders] )
Total Qty     = SUM ( Sales[Qty] )

Calculated column (in the Products table):
Price Band =
IF ( Products[UnitPrice] >= 40000, "Premium",
     IF ( Products[UnitPrice] >= 10000, "Mid", "Budget" ) )

Table visual: Region | Total Sales | Orders | Avg Order

Result

Region      | Total Sales | Orders | Avg Order
Kochi       | 129,000     | 2      | 64,500
Kozhikode   |   6,000     | 1      |  6,000
Trivandrum  |  48,000     | 1      | 48,000
Total       | 183,000     | 4      | 45,750

Download Power BI Desktop free from Microsoft (Windows). Re-create the small sample tables in Excel, load them, and follow the steps. Data is fictional.

Key points

  • Measures calculate on the fly for the current filters.
  • Calculated columns are stored per row — use them sparingly.
  • Use DIVIDE to avoid divide-by-zero errors.
  • Build small measures and reuse them.

Quick check

Which should you use for 'Total Sales' shown in many visuals?

Practice task

Create measures for Total Qty, Average Price per Unit (DIVIDE of sales by qty) and Number of Customers (DISTINCTCOUNT), and show them by Region.

Interview corner

What is the difference between a measure and a calculated column?

A calculated column is evaluated row by row at refresh and stored, using memory. A measure is evaluated at query time in the current filter context and isn't stored. Use measures for aggregations; columns only when you need a row-level value for slicing or relationships.

Why use DIVIDE instead of the / operator?

DIVIDE handles division by zero safely, returning blank (or an alternate value you choose) instead of an error, which keeps visuals clean.

Further reading

Official documentation, linked for deeper study. These are outside sites; this lesson's text is our own.

Original lesson written by the InfoparkDaily team · © 2026 InfoparkDaily · Free to learn — no paid course or subscription.