Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

DAX Measures in Excel: A Step-by-Step Guide

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

DAX measures let you create dynamic calculations in Excel's Power Pivot that respond to filters, slicers, and PivotTable context—unlike a calculated column, which is evaluated row by row. To build one, you need Excel with Power Pivot enabled (Windows only; not available on Mac), a data model loaded, and a basic idea of the result you want. The steps below walk you through creating, using, and troubleshooting measures. Menu labels can differ slightly by Excel version and region.

What You'll Need

  • Excel for Windows (Microsoft 365 or Excel 2019/2021). Power Pivot is not available in Excel for Mac.
  • The Power Pivot add-in enabled: File > Options > Add-ins > Manage: COM Add-ins > Go > check Microsoft Power Pivot for Excel.
  • Data loaded into the Data Model (Power Pivot > Manage > Home > Get Data, or via Power Query with "Add to Data Model" checked).
  • A PivotTable or Power Pivot window to test your measure.

Step-by-Step

  1. Load your data into the Data Model. Select your table, then go to Power Pivot > Add to Data Model, or use Data > Get Data and tick "Add this data to the Data Model." Confirm the table appears in the Power Pivot window.
  2. Open the Power Pivot window. Click Power Pivot > Manage. This is where measures are created and edited.
  3. Choose where to store the measure. In the Power Pivot window, select the table that logically owns the measure (for example, a Sales table for a Total Sales measure). Measures are stored in the table but are not tied to individual rows.
  4. Create a new measure. On the Home tab, click Measure > New Measure. (In some versions the button is labeled "Calculated Field" in the PivotTable Fields pane—same idea.)
  5. Name the measure. Use a clear name like Total Sales or Avg Order Value. Avoid names that match column names, which causes confusion.
  6. Write the DAX formula. In the Formula box, enter an expression such as Total Sales := SUM(Sales[Amount]). Use the table name in brackets and the column in brackets. For a ratio, use DIVIDE(SUM(Sales[Amount]), COUNTROWS(Sales)) to avoid divide-by-zero errors.
  7. Set the format. Choose Currency, Number, or Percentage and the decimal places. This format follows the measure wherever it is used.
  8. Click OK to save. The measure appears in the PivotTable Fields list with a small calculator icon.
  9. Add the measure to a PivotTable. Insert a PivotTable from the Data Model, then drag the measure into Values. Drag a category (like Region or Month) into Rows to see the measure recalculate per group.
  10. Test with filters and slicers. Add a slicer for a field such as Year or Product. The measure should update to reflect only the filtered rows—this is the key difference from a calculated column.
  11. Edit or delete as needed. In the Power Pivot window, select the measure in the calculation area and edit the formula, or right-click to delete. Changes propagate to all PivotTables using it.

Common Mistakes

  • Using a calculated column where a measure belongs. Calculated columns are computed row by row and stored; measures are computed at query time and respond to filters. If you need a total that changes with slicers, use a measure.
  • Forgetting the table name. DAX requires Table[Column] syntax. Writing just [Amount] can work for measures but not for columns.
  • Dividing without DIVIDE. Using / returns an error when the denominator is zero. Use DIVIDE() to return blank instead.
  • Naming a measure the same as a column. This creates ambiguity and confusing field lists.
  • Expecting measures on Mac. Power Pivot and DAX measures are Windows-only in Excel. On Mac, use regular PivotTable calculated fields instead.
  • Referencing a table that is not in the model. All tables used in a measure must be loaded into the Data Model.

Tips

  • Use CALCULATE() to modify filter context—for example, to show sales for a specific region regardless of slicer selection.
  • Keep measures in a dedicated "_Measures" table if you have many, to keep the field list tidy. You can create a blank table in Power Pivot for this purpose.
  • Use DIVIDE() for all ratios; it handles zero and blank gracefully.
  • Format measures consistently (currency, percentage) so PivotTables read cleanly.
  • Test each measure in a simple PivotTable before adding complexity.
  • Document formulas with comments in the DAX editor (using //) for future you.

Troubleshooting

  • Measure not appearing in PivotTable Fields: Confirm the PivotTable is connected to the Data Model (PivotTable Analyze > Data > Change Data Source). Measures only appear for model-based PivotTables.
  • Formula error "The name 'X' isn't valid": Check the table and column names exactly, including spaces. Use the formula autocomplete to insert names.
  • Measure returns blank: The filter context may exclude all rows, or a relationship is missing between tables. Check relationships in Power Pivot > Design > Manage Relationships.
  • Wrong totals: Verify you are using SUM and not AVERAGE, and that the measure is in Values, not Rows.
  • Power Pivot tab missing: Enable the COM add-in as described in What You'll Need. If it still does not appear, repair Office.
  • File slow or crashing: Large models can strain memory. Reduce columns, remove unused tables, and avoid overly complex measures until needed.

Frequently Asked Questions

Can I create DAX measures in Excel for Mac?

No. Power Pivot and DAX measures are available only in Excel for Windows. On Mac, use standard PivotTable calculated fields, which are less flexible.

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

A calculated column is computed row by row and stored in the table; a measure is computed at query time and responds to filters, slicers, and PivotTable layout.

Do measures work in regular PivotTables?

Only if the PivotTable is based on the Data Model. A PivotTable built from a plain worksheet range will not show measures.

Can I use a measure in a chart or dashboard?

Yes, any PivotChart or PivotTable connected to the Data Model can use measures. They also work in Power View and some other Excel features that read the model.

How do I edit a measure after creating it?

Open Power Pivot > Manage, find the measure in the calculation area below the table, and edit the formula directly. Changes apply to all PivotTables using it.

Why does my measure show the same value in every row?

You likely used a filter that ignores row context, or the measure does not reference a column that changes per row. Use CALCULATE with appropriate filters, or check that the measure is in Values and not a calculated column.