Percent of total with ALL

What share of sales does each category have? Every row needs two numbers: its own sales and the sales without the row's filter. CALCULATE with ALL provides the second one.

In short: DIVIDE([Total Sales], CALCULATE([Total Sales], ALL(Product[Category]))). ALL removes the filter on the category; every other filter stays. If the slicer should count, use ALLSELECTED.

Before this: CALCULATE.

Try it now

Task What share of total sales does each category have? Create the measure "Category Share": [Total Sales] divided by the sales of all categories. Calculate the denominator with CALCULATE and ALL.

Sales 120 rows, 7 columns
OrderIDOrderDateShipDateProductIDRegionIDQuantityAmount
13 Oct 20266 Oct 20261221798
29 Nov 202519 Nov 20252351145
320 Sep 202627 Sep 2026544596
416 Jun 20252 Jul 20252151145
526 Mar 202631 Mar 20261343596
64 Dec 202510 Dec 2025545745
78 Jul 202526 Jul 2025614196
820 Feb 20251 Mar 202532359.7
99 Dec 202524 Dec 202562298
1012 Aug 202625 Aug 2026212458
117 Sep 202612 Sep 2026542298
122 Mar 202614 Mar 2026623147

Showing the first 12 of 120 rows.

Measures: [Total Sales]

Product 6 rows, 4 columns
ProductIDProductCategoryPrice
1LaptopHardware899
2MonitorHardware229
3MouseAccessories19.9
4KeyboardAccessories39.9
5Office suiteSoftware149
6AntivirusSoftware49
Region 4 rows, 2 columns
RegionIDRegion
1North
2South
3West
4East
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

Showing the first 12 of 730 rows.

What ALL removes

Filter argumentRemoves
ALL(Product[Category])only the filter on the category
ALL(Product)all filters on the Product table
REMOVEFILTERS(Product[Category])the same as ALL, with a clearer name
ALLEXCEPT(Sales, Region[Region])all filters on the table and its dimensions, except the region

The column has to match: with products in the rows, ALL(Product[Category]) removes nothing and every row shows 100%. Then use ALL(Product[Product]) or ALL(Product).

Share of the selection: ALLSELECTED

If someone selected only some regions in the slicer, ALL still counts all of them. The shares then add up to less than 100%. ALLSELECTED only removes the row's filter and keeps what is selected in the report.

Task Three regions are selected in the slicer. Create the measure "Share of Selection": each region's share of the sales of the selected regions, so that the rows add up to 100%.

Sales 120 rows, 7 columns
OrderIDOrderDateShipDateProductIDRegionIDQuantityAmount
13 Oct 20266 Oct 20261221798
29 Nov 202519 Nov 20252351145
320 Sep 202627 Sep 2026544596
416 Jun 20252 Jul 20252151145
526 Mar 202631 Mar 20261343596
64 Dec 202510 Dec 2025545745
78 Jul 202526 Jul 2025614196
820 Feb 20251 Mar 202532359.7
99 Dec 202524 Dec 202562298
1012 Aug 202625 Aug 2026212458
117 Sep 202612 Sep 2026542298
122 Mar 202614 Mar 2026623147

Showing the first 12 of 120 rows.

Measures: [Total Sales]

Product 6 rows, 4 columns
ProductIDProductCategoryPrice
1LaptopHardware899
2MonitorHardware229
3MouseAccessories19.9
4KeyboardAccessories39.9
5Office suiteSoftware149
6AntivirusSoftware49
Region 4 rows, 2 columns
RegionIDRegion
1North
2South
3West
4East
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

Showing the first 12 of 730 rows.

This exercise is part of Premium.

Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.

See Premium Already Premium? Log in

The first exercise in this lesson is free.

In real Power BI

  1. Create a new measure with the formula and choose the Percentage format under Measure tools.
  2. Put it in a matrix next to [Total Sales]. The total row must show 100%.
  3. For simple cases there is also "Show value as", "Percent of grand total" in the context menu of the value in the visual. A measure, however, can be reused in cards, charts and other measures.

Common mistakes

Without CALCULATE

DIVIDE([Total Sales], ALL(Product)) returns an error: ALL returns a table, not a number. Only CALCULATE turns it into a changed filter.

Wrong column in ALL

ALL has to hit the column that is in the rows, or a table it belongs to.

FAQ

ALL or REMOVEFILTERS?

As a filter in CALCULATE both work the same. REMOVEFILTERS says more clearly what happens; ALL can also be used as a table, for example in RANKX(ALL(…), …).

Why does the total row show 100%?

There is no filter on the category there, so numerator and denominator are equal.

Up next: SUMX and iterators

Calculating row by row, and conditions on measures with FILTER.

Next lesson

Write to us

Choose language

Select your preferred language