ALLSELECTED Question

JB2020

Board Regular
Joined
Jul 29, 2020
Messages
88
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
I have 2 tables in my data model. One, named 'Data Table', has 4 fields: Date, Index, Category and Value. The other is a calendar. These tables are joined on the Date field.

I have a pivot table which uses my data model and has 2 slicers applied to it: 'Data Table'[Category] and Calendar[Date (Year)]. This pivot table has Index as the rows, and [Sum of Value] in the values.

I want to use a measure which will show the average of Value for all selected values (so, average of Value where 'Data Table'[Category] = {Category slicer selection} and 'Data Table'[Date] = {Calendar[Date] slicer selection}) . I am currently using =CALCULATE(AVERAGE('Data Table'[Value]),ALLSELECTED()) for this.

This seems to produce the desired result, however the pivot table will display all of the 'Index' rows, ignoring any calendar slicers, with [Sum of Value] producing blank values for each row where the calendar filter applies.

Without Measure
IndexSum of Value
3
38.38423414​
4
3.200046329​
8
95.27267842​

With Measure
IndexSum of ValueAverageAll
3
38.38423414​
45.6189863​
4
3.200046329​
45.6189863​
8
95.27267842​
45.6189863​
10
45.6189863​
12
45.6189863​
14
45.6189863​
15
45.6189863​

I would like to be able to adjust this so that the additional rows do not appear. Hopefully this all makes sense, please let me know if any clarification is required though. Thanks in advance.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,223,702
Messages
6,173,959
Members
452,539
Latest member
delvey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top