DataTalksWithSaud

Why a DAX measure changes when you use a slicer

Use a small Power BI report to see how slicers, relationships, and CALCULATE affect a DAX measure.

Put the same sales measure in a card and in a table grouped by product category. The card returns one number. Each category row returns a different number, even though every row evaluates the same measure.

Build the smallest example

In a practice model, create a Product table with one row per product and a Sales table with one row per sale. Relate Product to Sales on ProductKey with filters flowing from Product to Sales. Create this measure:

Total Sales = SUM(Sales[Amount])

Add a card with Total Sales. Add a table with Product[Category] and Total Sales. In the table, each row filters Product to one category, and the active relationship carries that filter into Sales. Add a category slicer and compare the card before and after a selection.

Check which filter the calculation removes

Sales Across Categories =
    CALCULATE([Total Sales], REMOVEFILTERS(Product[Category]))

Add the second measure to the table. It removes the filter on Product[Category] while keeping filters on other columns, such as a date filter from a related date table. Use a known total to check the result before applying the pattern to a real report.

CALCULATE reference on Microsoft Learn

Analytics preferences

You can allow Google Analytics to measure visits and resource clicks. Either choice lets you use the whole site.