Search…

DAX Functions

ALLSELECTED vs ALL in Power BI - DAX Explained With Examples

ALLSELECTED vs ALL in Power BI - DAX Explained With Examples

Learn the difference between ALLSELECTED vs ALL in Power BI with clear DAX examples. Understand how each function removes filters, affects visuals, and when to use them for correct calculations.

Learn the difference between ALLSELECTED vs ALL in Power BI with clear DAX examples. Understand how each function removes filters, affects visuals, and when to use them for correct calculations.

Written By: Sajagan Thirugnanam and Austin Levine

Last Updated on February 19, 2026

Introduction

If you’ve ever written a DAX measure in Power BI and thought:

“Why is my total ignoring the slicer?”
or
“Why is my percentage calculation wrong?”

Then you’ve probably encountered one of the most confusing DAX battles: 

ALL() vs ALLSELECTED()

These two functions look similar because both remove filters. But in reality, they behave very differently depending on slicers, report filters, visual filters, and the current context.

In this guide, we’ll break down ALLSELECTED vs ALL in Power BI, with simple explanations and real DAX examples you can use in dashboards.

What Does ALL() Do in Power BI?

The ALL() function removes filters from a table or column.

It essentially tells Power BI: “Ignore all filters on this column/table and calculate using the full dataset.”

Basic Syntax

ALL(TableName)

or

ALL(TableName[ColumnName])

What ALL() Removes

ALL() removes filters coming from:

  • Slicers

  • Report filters

  • Page filters

  • Visual filters

  • Cross-filtering from other visuals

So in most cases, it resets the filter context completely.

What Does ALLSELECTED() Do in Power BI?

The ALLSELECTED() function removes filters only inside the current visual context, but still respects the user’s selections (especially slicers).

It tells Power BI: “Remove visual-level filters, but respect slicers and external filters selected by the user.”

Basic Syntax

ALLSELECTED (TableName)

or

ALLSELECTED (TableName[ColumnName])

What ALLSELECTED() Keeps

ALLSELECTED() typically keeps filters from:

  • Slicers (user selections)

  • Page-level filters

  • Report-level filters

But it removes filters applied inside the visual. This makes it extremely useful for calculating:

  • Percent of selected total

  • Rankings inside selected group

  • Dynamic totals that still follow slicers

ALLSELECTED vs ALL: Key Difference

Here’s the simplest way to understand it:

ALL()

Ignores everything. Even slicers and user selections.

ALLSELECTED()

Ignores only the visual filters. But respects what the user selected on slicers.

That’s why these two functions often produce totally different results.

ALL vs ALLSELECTED Comparison Table

Function

Removes Slicer Filters?

Removes Visual Filters?

Best Use Case

ALL()

✅ Yes

✅ Yes

Grand totals, removing all filters

ALLSELECTED()

❌ No (usually keeps slicers)

✅ Yes

Percent of selected total, slicer-based totals

Why ALLSELECTED() Is So Important in Dashboards

In real reports, users interact using slicers. They expect calculations to adjust accordingly. That’s why ALLSELECTED() is extremely useful when you want:

  • totals that still respond to slicers

  • correct percentages within selected filters

  • dynamic rankings inside a chosen segment

Real Use Case: Percent of Total (ALL vs ALLSELECTED)

This is the most common scenario where people mess up.

Goal

You want to calculate: Product Sales ÷ Total Sales

Option A: Percent of Grand Total (Using ALL)

Percent of Grand Total = 
  DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], ALL ( Sales ) ) )

This gives percent of total sales across the entire dataset.

Even if the user selects East, the denominator remains the full dataset.

Option B: Percent of Selected Total (Using ALLSELECTED)

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

Now the denominator changes depending on slicer selection.

If the user selects East, the denominator becomes East total only.

This is typically what dashboard users expect.

ALLSELECTED Parameters and Advanced Usage

ALLSELECTED() can take either a table, a single column, or multiple columns, which gives you more control over which filters get removed.

Syntax

ALLSELECTED ( TableName )
ALLSELECTED ( TableName[ColumnName] )
ALLSELECTED ( TableName[Column1], TableName[Column2] )

Why Parameters Matter

  • Using ALLSELECTED(Sales) removes filters from the entire table (but still respects slicers).

  • Using ALLSELECTED(Sales[Product]) removes filters only on Product, which is useful for rankings and percent-of-subtotal calculations.

  • Using multiple columns is helpful in matrix visuals when you want totals to reset only for specific dimensions.

Common Advanced Use Case (Ranking)

Rank Product (Selected) = 
  RANKX ( ALLSELECTED ( Sales[Product] ), [Total Sales], , DESC )

This makes rankings update dynamically based on slicers like Region, Year, or Category; perfect for interactive dashboards.

Common Mistake: ALL() Breaking Slicer Logic

A very common beginner error is writing a measure like this:

Total Sales Wrong = CALCULATE ( [Total Sales], ALL ( Sales ) )

This measure will ignore all slicers and filters, which can confuse report users. Your report might show East selected, but totals still include West.

That makes your dashboard feel broken.

When to Use ALL() in Power BI

Use ALL() when you want a calculation to ignore filters completely.

Best Use Cases for ALL()

  • Grand total comparisons

  • Remove slicer filters intentionally

  • Benchmarking against overall performance

  • Fixed totals (company-wide KPIs)

  • Calculating market share vs global total

Example:

Company Benchmark = CALCULATE ( [Total Sales], ALL ( Sales ) )

When to Use ALLSELECTED() in Power BI

Use ALLSELECTED() when you want calculations to respect slicers but ignore visual-level filtering.

Best Use Cases for ALLSELECTED()

  • Percent of selected total

  • Rankings within slicer selections

  • Dynamic totals that match user filters

  • Visual-level context removal

  • Interactive dashboards

Example:

Sales Share Within Selected Region = 
  DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], ALLSELECTED ( Sales ) ) )

Advanced Tip: ALLSELECTED Can Behave Unexpectedly

One important warning: ALLSELECTED() depends heavily on the current query context, which can change depending on:

  • visual type

  • drill-down level

  • matrix rows/columns

  • interactions between visuals

So sometimes you might get results that feel inconsistent.

That’s not a bug, it’s just how DAX context works.

If you want predictable results, you may need to combine it with other functions like:

  • REMOVEFILTERS()

  • ALLEXCEPT()

  • KEEPFILTERS()

ALL() vs REMOVEFILTERS(): Are They the Same?

Many Power BI users ask: Is ALL the same as REMOVEFILTERS?

They behave similarly, but REMOVEFILTERS() is considered the more modern and readable approach.

Example:

CALCULATE ( [Total Sales], REMOVEFILTERS ( Sales[Region] ) )

This is often clearer than ALL().

However, ALL() still remains very common and widely used.

Best Practice Recommendation

At CaseWhen, we usually recommend:

  • Use ALL() when you need a fixed benchmark KPI

  • Use ALLSELECTED() when the report is interactive and user-driven

  • Always test your measure with slicers + cross filtering enabled

Because the biggest mistake in DAX isn’t writing wrong formulas.

It’s writing formulas that behave differently than users expect.

Quick Summary: ALLSELECTED vs ALL Power BI

Here’s the cheat sheet:

  • ALL() removes all filters and gives a true grand total

  • ALLSELECTED() keeps slicer selections but removes visual context filters

  • Use ALL() for benchmarking and global totals

  • Use ALLSELECTED() for percentages and rankings inside slicer context

Final Thoughts

Understanding ALLSELECTED vs ALL in Power BI is a major step toward mastering DAX.

Most DAX errors happen because developers misunderstand context, not because the formula itself is wrong.

Want Help Writing Better DAX Measures?

At CaseWhen, we help businesses build clean data models and scalable Power BI reports with optimized DAX measures that perform well even on large datasets. To learn more about DAX, check out our article on the differences between measures and calculated columns

If your dashboard is slow, your measures are inconsistent, or your totals don’t match expectations, we can help.

FAQs

What is the difference between ALL and ALLSELECTED in DAX?

ALL() removes all filters from the calculation, including slicers. On the other hand, ALLSELECTED() removes visual-level filters but respects slicer and external selections.

Does ALLSELECTED ignore slicers?

No, ALLSELECTED() typically respects slicers and page/report filters. That’s why it is useful for calculating percent of selected total.

When should I use ALL function in Power BI?

Use ALL() when you need a measure that ignores filters completely, such as calculating a global benchmark or overall company KPI.

Related to DAX Functions

Want Power BI expertise in-house?

Get in Touch With Us

Turn your team into Power BI pros and establish reliable, company-wide reporting.

Berlin, DE

powerbi@casewhen.co

Follow us on

© 2026 CaseWhen Consulting
© 2026 CaseWhen Consulting
© 2026 CaseWhen Consulting