Power BI Intermediate Lesson 2: % of Total With ALL, ALLEXCEPT and REMOVEFILTERS

Power BI Intermediate Lesson 2: % of Total With ALL, ALLEXCEPT and REMOVEFILTERS 1

πŸ“Ž This article includes 3 downloadable practice files ↓

⏱ 2 min read

πŸ“˜ Power BI Intermediate Course Β· Lesson 2 of 10

Advertisement

A share needs two numbers: the current one and a bigger one with some filters removed.

% of Total       = DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], REMOVEFILTERS ( Customers[Region] ) ) )
% of Grand Total = DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], ALL ( Sales ) ) )
% of Category    = DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], ALLEXCEPT ( Products, Products[Category] ) ) )
Region % of total
North 36.1%
South 28.0%
West 25.6%
East 10.4%

Laptops are 73.4% of Computers sales: ALLEXCEPT removes the product filter but keeps the category.

Which remover?

  • REMOVEFILTERS(column): clearest; removes filters from that column only. Slicers on other fields (e.g. FY) still apply.
  • ALL(table): removes every filter on the table, slicers included. Use for a true grand total.
  • ALLSELECTED(column): respects the user’s slicer but ignores the visual’s own grouping: “share of what’s selected”.
⚠️ If the % column shows 100% on every row, the measure removed the wrong filter. The row filter comes from Customers[Region], so remove it from that column, not from Sales.

Practice

Import pbi-intermediate-model.xlsx into Power BI Desktop (free), create the relationships listed at the top of the .dax file, mark the Date table as a date table and add this lesson’s measures. Compare your card and table values with the lesson’s sheet in the expected-results file. Those numbers were worked out independently in Python from the same data, so a mismatch means a filter or relationship to check.

πŸ“Ž Practice files for this article

⬇ Download all 3 files (ZIP Β· 61 KB)

  • πŸ“—
    Practice model (Excel)Two years of sales (700 orders, FY 2024-25 and 2025-26) with Customers, Products, a full Date table, Targets and RegionUsers.
    ⬇ XLSX Β· 63 KB
  • πŸ“„
    Lesson 2 measures (.dax)Every measure from this lesson, ready to paste into Power BI Desktop.
    ⬇ DAX Β· 837 B
  • πŸ“—
    Expected resultsThe numbers your measures should show, one sheet per lesson.
    ⬇ XLSX Β· 11 KB

Free to use for learning. Files with macros (.bas) are plain text β€” import them with Alt+F11 β†’ File β†’ Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free Β· AI can be wrong