New: free Power BI model health check. Find what's making your numbers wrong and your model slow. Check your model →
DAX Practice

Do you know what this measure returns?

Reading about filter context is one thing. Predicting what a measure shows in a real visual is another, and it's the skill that actually fixes reports. Each exercise gives you a measure, a visual, and three answers. Pick one and see why it's right or wrong.

Free, no sign-up. Your progress is saved in this browser. Want to experiment instead? Try the interactive examples.

The model

Every exercise runs against these tables, so you can check any answer by hand. Sales relates to Product on Product, and to a full 2025–2026 Date table on Date, with Year, Month (the month name), and Month Number columns. [Total Sales] is SUM ( Sales[Amount] ).

Sales

OrderDateProductRegionQtyAmount
12025-01-15WidgetNorth2200
22025-01-20GadgetNorth1150
32025-02-03WidgetSouth3300
42025-02-18GizmoSouth150
52025-03-05GadgetNorth2300
62025-03-22WidgetSouth1100
72026-01-10WidgetNorth4400
82026-02-14GizmoNorth2100

Product

ProductCategoryPrice
WidgetHardware100
GadgetHardware150
GizmoAccessories50
0 / 31 correct
#1Beginner

Counting products

A card visual, with no slicers or filters on the page, shows this measure.

Products Sold = DISTINCTCOUNT ( Sales[Product] )

What does the card show?

#2Beginner

Average order value by region

A table visual has Sales[Region] on rows and this measure as a value. [Total Sales] is SUM ( Sales[Amount] ).

Avg Order = DIVIDE ( [Total Sales], COUNTROWS ( Sales ) )

What does the South row show?

#3Beginner

Revenue from quantity and price

Suppose Sales had no Amount column, only Qty, and the price lives on the Product table. Sales relates to Product on Product, many to one.

-- Target: a measure that returns 1,600 in a card with no filters

Which measure returns the true revenue, 1,600?

#4Beginner

Counting big orders

A card visual with no filters shows this measure.

Big Orders = COUNTROWS ( FILTER ( Sales, Sales[Amount] > 200 ) )

What does the card show?

#5Beginner

Average quantity

A card visual with no filters shows this measure.

Avg Qty = AVERAGE ( Sales[Qty] )

What does the card show?

#6Filter context

CALCULATE on a region table

A table visual has Sales[Region] on rows: North and South.

North Sales =
CALCULATE ( [Total Sales], Sales[Region] = "North" )

What does the South row show?

#7Filter context

The same measure with KEEPFILTERS

Same table visual, Sales[Region] on rows. The filter is now wrapped in KEEPFILTERS.

North Sales =
CALCULATE ( [Total Sales], KEEPFILTERS ( Sales[Region] = "North" ) )

What does the South row show now?

#8Filter context

Percent of total that shows 100%

A table visual has Product[Product] on rows.

% of Total =
DIVIDE (
    [Total Sales],
    CALCULATE ( [Total Sales], ALL ( Product[Category] ) )
)

What does the Gizmo row show?

#9Filter context

A calculated column that totals sales

This is a calculated column added to the Product table, not a measure.

Product Sales = SUM ( Sales[Amount] )

What value does the Gizmo row of the Product table get?

#10Filter context

A filter on a different column

A table visual has Product[Product] on rows.

Hardware Sales =
CALCULATE ( [Total Sales], Product[Category] = "Hardware" )

What does the Gizmo row show?

#11Filter context

OR across two columns

A card visual with no filters. Both columns are in the Sales table.

North or Widget =
CALCULATE ( [Total Sales], Sales[Region] = "North" || Sales[Product] = "Widget" )

What does the card show?

#12Filter context

Counting products by region

A table visual has Sales[Region] on rows. Product relates to Sales one-to-many, with the default single cross-filter direction.

Product Count = COUNTROWS ( Product )

What does the South row show?

#13Filter context

Share of the selection

A table visual has Product[Product] on rows. A slicer on Product[Product] has Widget and Gadget selected, so Gizmo isn't shown.

% of Selected =
DIVIDE (
    [Total Sales],
    CALCULATE ( [Total Sales], ALLSELECTED ( Product[Product] ) )
)

What does the Widget row show?

#14Iterators & ranking

Products with big sales

A card visual with no filters. The author wants the number of products with more than 400 in sales.

Big Products =
COUNTROWS (
    FILTER ( VALUES ( Product[Product] ), SUM ( Sales[Amount] ) > 400 )
)

What does the card show?

#15Iterators & ranking

SUMX over products

A card visual with no filters.

Sales by Product = SUMX ( Product, SUM ( Sales[Amount] ) )

What does the card show?

#16Iterators & ranking

A rank that's always 1

A table visual has Product[Product] on rows.

Sales Rank = RANKX ( Product, [Total Sales] )

What does the Gadget row show?

#17Iterators & ranking

The best month

A card visual with no filters. 'Date'[Month] holds the month name (January, February, ...), with no year.

Best Month Sales = MAXX ( VALUES ( 'Date'[Month] ), [Total Sales] )

What does the card show?

#18Iterators & ranking

Average sales per product

A card visual with no filters.

Avg per Product = AVERAGEX ( VALUES ( Sales[Product] ), [Total Sales] )

What does the card show?

#19Time intelligence

Year-to-date in February

A matrix has 'Date'[Year] and 'Date'[Month] on rows. 'Date' is a full calendar table for 2025–2026, marked as a date table and related to Sales[Date].

Sales YTD = TOTALYTD ( [Total Sales], 'Date'[Date] )

What does the February 2025 row show?

#20Time intelligence

Year-to-date on the total row

Same matrix and the same Sales YTD measure. Look at the subtotal row for the year 2025.

Sales YTD = TOTALYTD ( [Total Sales], 'Date'[Date] )

What does the 2025 subtotal row show?

#21Time intelligence

Last year, in a month with no sales

Same matrix. There are no sales at all in March 2026.

Sales LY =
CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )

What does the March 2026 row show for Sales LY?

#22Time intelligence

The previous month

A matrix has 'Date'[Year] and 'Date'[Month] on rows.

Sales PM =
CALCULATE ( [Total Sales], DATEADD ( 'Date'[Date], -1, MONTH ) )

What does the January 2026 row show?

#23Time intelligence

Year-to-date in a new year

Same matrix, by Year and Month.

Sales YTD = TOTALYTD ( [Total Sales], 'Date'[Date] )

What does the January 2026 row show?

#24Time intelligence

Last year, on a year that's not over

Same matrix. The data stops in February 2026. Look at the 2026 subtotal.

Sales LY =
CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )

What does the 2026 subtotal show for Sales LY?

#25Fix the bug

Counting big orders

This measure won't save. Power BI says a function has been used in a True/False expression used as a table filter expression.

Big Orders =
CALCULATE ( COUNTROWS ( Sales ), [Total Sales] > 200 )

Which version counts orders over 200 correctly?

#26Fix the bug

A variable CALCULATE can't change

A card with no filters shows this measure. The author expected North's total.

North Sales =
VAR Total = [Total Sales]
RETURN
    CALCULATE ( Total, Sales[Region] = "North" )

What does the card show?

#27Fix the bug

Share of year: 100% every month

A matrix has 'Date'[Month] on rows, and Month is sorted by 'Date'[Month Number]. Every month shows 100%.

Share of Year =
DIVIDE (
    [Total Sales],
    CALCULATE ( [Total Sales], ALL ( 'Date'[Month] ) )
)

Which denominator fixes it?

#28Fix the bug

Lowercase in a filter

A card with no filters. The product is spelled "Widget" in the data, but the measure says "widget".

Widget Sales =
CALCULATE ( [Total Sales], Product[Product] = "widget" )

What does the card show?

#29Fix the bug

Products that won't go away

A table visual has Product[Product] and this measure. A slicer is set to 'Date'[Year] = 2026. The author expected only products with 2026 sales.

Status = IF ( [Total Sales] > 0, "Active", "None" )

How many rows does the table show?

#30Fix the bug

A total that disappears

A table visual has Product[Product] on rows, with a total row.

Revenue =
SUM ( Sales[Qty] ) * SELECTEDVALUE ( Product[Price] )

What does the total row show?

#31Fix the bug

Days between two dates

A card visual with no filters. The author wants the number of days from the first sale to the last.

Days Selling =
MAX ( Sales[Date] ) - MIN ( Sales[Date] )

What does the card show?

Studying for the exam? The PL-300 study guide maps every skill to a page and has scenario questions for each area. Got one wrong here? That's the point. Each answer links to the page that explains it. For the full picture, start with filter context and CALCULATE.