DAX and Data Modeling
Written By: Sajagan Thirugnanam
Last Updated on September 23, 2026
ALL removes every filter from the table or columns you give it, including slicers, so a measure using it returns the same total whatever the reader selects. ALLSELECTED removes only the filters that come from inside the visual, such as its rows, columns and axis, and keeps the filters from slicers, other visuals and the Filters pane. Use ALL for a fixed grand total and ALLSELECTED for a total that matches what the reader has selected.
Both are used inside CALCULATE, most often for percent-of-total and ranking measures.
What Does ALL() Do in Power BI?
ALL returns all the rows of a table, or all the values of one or more columns, ignoring any filters on them. Used as a filter inside CALCULATE, it removes those filters for that calculation.
Basic Syntax
What ALL() Removes
ALL removes filters on the table or columns you pass it, wherever the filter came from:
Slicers
Page and report filters
Visual filters in the Filters pane
The visual's own rows, columns and axis
Cross-filtering from other visuals
It does not touch filters on other columns. ALL ( 'Product'[Category] ) clears the category filter and leaves a Region slicer in place. ALL ( Sales ) on a fact table also clears filters on the dimension tables related to it, such as Product, Customer and Date. The row context vs filter context post explains where these filters come from.
What Does ALLSELECTED() Do in Power BI?
ALLSELECTED ignores the filters applied inside the current visual, and keeps every filter that comes from outside it. Microsoft describes it as keeping "explicit filters and contexts other than row and column filters".
In practice, inside a table visual grouped by product category:
The category on each row of the visual is removed.
A Region slicer, a page filter or a Filters pane filter on the visual stays.
Basic Syntax
With no argument, it restores the visual's outer context for every table. When you pass several columns, they must come from the same table.
What ALLSELECTED() Keeps
Slicer selections
Page-level and report-level filters
Filters on the visual set in the Filters pane
Cross-filtering from other visuals
It removes the grouping filters on the columns you pass that the visual itself adds. That makes it the right function for:
Percent of the selected total
Rankings inside the selected group
Totals that follow slicers
ALLSELECTED vs ALL: Key Difference
ALL()
Ignores every filter on the columns you give it, including slicers.
ALLSELECTED()
Ignores only the visual's own grouping on those columns and keeps what the reader selected.
ALL vs ALLSELECTED Comparison Table
Function | Removes slicer filters on its columns | Removes the visual's row and column grouping | Best use case |
|---|---|---|---|
ALL | Yes | Yes | Grand totals and fixed benchmarks |
ALLSELECTED | No | Yes | Percent of selected total, rankings that follow slicers |
Why ALLSELECTED() Is So Important in Dashboards
Readers interact through slicers and cross-filtering, and they expect a total or percentage to follow what they picked. A share column that always divides by the company-wide total looks wrong the moment someone filters to one region. ALLSELECTED keeps the denominator in step with the selection.
Real Use Case: Percent of Total (ALL vs ALLSELECTED)
Goal
A table visual shows sales by product category, and a Region slicer sits on the page. Each row should show that category's share of total sales.
Option A: Percent of Grand Total (Using ALL)
The denominator is total sales across all categories. The Region slicer still applies, because ALL only clears the Category filter. ALL accepts several columns only when they come from the same table, so to ignore the Region slicer as well, add a second filter argument:
Option B: Percent of Selected Total (Using ALLSELECTED)
The denominator is the total of the categories the reader can see. If a Category slicer is set to Bikes and Accessories, the two rows add up to 100 percent. With Option A, the same two rows add up to their share of all categories.
ALLSELECTED Parameters and Advanced Usage
Syntax
Why Parameters Matter
ALLSELECTED ( )restores the outer context for every table. It gives the visual total.ALLSELECTED ( 'Product' )does it for the Product table only.ALLSELECTED ( 'Product'[Subcategory] )does it for one column. In a matrix with Category and then Subcategory on rows, it removes the subcategory grouping and keeps the category grouping. Each subcategory row then divides by its own category total, which gives a percent-of-parent measure.
Common Advanced Use Case (Ranking)
This ranks each product among the products the reader can see. Change a Region or Year slicer and the ranks recalculate for that selection. RANKX ranks in descending order by default. The RANKX guide covers ties and sort order.
Common Mistake: ALL() Breaking Slicer Logic
This measure ignores every filter on Sales and on the tables related to it. If a reader selects East in a Region slicer, the measure still includes West. Placed next to regular sales in a table, it looks broken.
The same formula is correct when you want a fixed company-wide number, as in the benchmark example below. The mistake is using it where the reader expects the number to follow the slicer. Use ALLSELECTED there instead.
When to Use ALL() in Power BI
Use ALL when a calculation must ignore the reader's selection on certain columns.
Best Use Cases for ALL()
Grand totals as a fixed denominator
Benchmarks against company-wide performance
Market share against the full market
KPIs that must not move with slicers
Example:
When to Use ALLSELECTED() in Power BI
Use ALLSELECTED when a calculation must respect slicers but ignore the visual's own grouping.
Best Use Cases for ALLSELECTED()
Percent of selected total
Rankings within the selection
Visual totals that match the reader's filters
Example:
Advanced Tip: ALLSELECTED Can Behave Unexpectedly
ALLSELECTED depends on the query the visual sends, so the result can change with:
the visual type
the drill-down level
which fields are on rows and columns of a matrix
interactions between visuals
It is also sensitive to iterators. When a measure using ALLSELECTED is called inside SUMX, FILTER or RANKX, the iteration can change what "selected" means. If a result looks inconsistent, test the measure on its own in a simple table visual first. When you need a result that never depends on the visual, use ALL, REMOVEFILTERS or ALLEXCEPT on explicit columns instead.
ALL() vs REMOVEFILTERS(): Are They the Same?
Inside CALCULATE, REMOVEFILTERS ( Sales[Region] ) and ALL ( Sales[Region] ) remove the same filters and return the same result:
The difference is what else they can do. ALL can also return a table, for example as the first argument of FILTER or RANKX. REMOVEFILTERS can only clear filters. Microsoft recommends REMOVEFILTERS when all you want is to remove filters, because the name says what it does.
Best Practice Recommendation
Use ALL or REMOVEFILTERS for fixed benchmarks and grand totals.
Use ALLSELECTED for totals and ranks that should follow the reader's selection.
Pass the narrowest columns that do the job, rather than a whole table.
Test every new measure with a slicer set and with cross-filtering from another visual.
The CALCULATE guide covers how these modifiers combine with other filters. For where to put these measures in the model, see measures vs calculated columns. If a percent-of-total visual is slow, the DAX performance guide explains how to find out why.
FAQs
What is the difference between ALL and ALLSELECTED in DAX?
ALL removes every filter on the table or columns you pass it, including slicers. ALLSELECTED removes only the filters the visual itself adds through its rows, columns and axis, and keeps slicers, page and report filters, and Filters pane filters.
Does ALLSELECTED ignore slicers?
No. ALLSELECTED keeps slicer selections and other filters from outside the visual. That is why it is used for percent of the selected total.
When should I use ALL function in Power BI?
When a measure must return the same value whatever the reader selects on certain columns, for example a company-wide benchmark or a fixed grand total in a percent-of-total measure.
Sources
ALLSELECTED function (DAX) - Microsoft Learn
ALL function (DAX) - Microsoft Learn
REMOVEFILTERS function (DAX) - Microsoft Learn
CALCULATE function (DAX) - Microsoft Learn
Related to DAX and Data Modeling