Sum of TOPN by Filtered Date Range

SpillerBD

Well-known Member
Joined
Jul 2, 2014
Messages
2,853
Office Version
  1. 365
Platform
  1. Windows
Trying to have a measure provide the same results as only the Grand Totals of the following vanilla PivotTable.
Table AcctList
Fields, [DueDate], [Amount], [Name], [Validated/Held]
Page Filters = [Validated] = “Validated”
Rows = [Name]
Columns= [DueDate]
Sigmas = Sum of [Amounts]
Row Filter = Top20 by Value Sum of [Amounts]
Column Filter = Date Filter = This Month
My Measure for the Totals
TotalValidated:= CALCULATE(sum([Amount]), AcctList [Validated/Held]="Validated")

The Following Fails as it looks at the Top20 per day and not the Total Amounts as filtered in the Pivot Table.

MyTop20:= CALCULATE([Validated Payables],TOPN(20, AcctList,[Validated Payables]))

I plan on also providing the BotomN amounts by simply subtractacting the MyTop20 from TotalValidated
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I’m not totally clear what filters you are putting on your measure, but try trapping the TOPN in a CALCULATETABLE with ALLSELECTED ( AccList[DueDate] ) as the second clause.
 
Upvote 0
I guess what I am not doing is feeding the TOPN the right Table. I should (?) be feeding the TOPN a summary table of the Amounts by [Name] with the recommendation of the ALLSELECTED by gazpage.

I think I still have some "old learning" in my way of the new. In the meantime, I will be iterating on Chapters 4 and 5 of Marco's book, with Matt's and Rob's books too.
 
Upvote 0

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

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