Auto select latest 4 dates in Pivot - Column Filter

shansakhi

Active Member
Joined
Apr 5, 2008
Messages
276
Office Version
  1. 365
Platform
  1. Windows
Hello Everybody,
I am working on a huge data which has multiple dates and I want to display data only for latest 4 dates.
How can I Auto select latest 4 dates in Pivot - Column Filter.

Regards,
Shan
 
I think you will be better off starting a new thread under the Forum category > Power Tools and make it clear you need Power BI expertise.
Also do you have control over the Power BI application ie can you make changes to it.
In Power BI you could probably achieve what you want using either Power Query or DAX but you need someone who has done it before to guide you.
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
As much as I love Power Query, sometimes there's an easier way to get the information needed. Of course, that depends on the information needed is communicated clearly. "I want to display data only for latest 4 dates" when the data provided has three date values the same. So I'm assuming that what's needed is the TOTAL (or average?) for the last 4 largest dates. That means determining how many items are part of the "largest date" group, and so on through the second, third, and fourth groups. Like this:
Book1
ABCDEFGHI
1MonthAs of Date CapacityLast 4 DatesTotal CapacityNext Rank# of Matches
2Jan08-12-22654,54108-12-221,902,20213
3Jan01-12-22624,40901-12-221,818,26943
4Jan24-11-22651,92724-11-221,896,22073
5Jan17-11-22626,10917-11-221,827,646103
6Jan10-11-22603,571
7Feb08-12-22591,093
8Feb01-12-22563,715
9Feb24-11-22588,339
10Feb17-11-22565,605
11Feb10-11-22533,425
12Mar08-12-22656,568
13Mar01-12-22630,145
14Mar24-11-22655,954
15Mar17-11-22635,932
16Mar10-11-22601,829
Sheet6
Cell Formulas
RangeFormula
E2:E5E2=LARGE($B$2:$B$16,H2)
F2:F5F2=SUMIFS($C$2:$C$16,$B$2:$B$16,E2)
I2:I5I2=COUNTIFS(B2:B16,E2)
H3H3=H2+I2
H4:H5H4=I3+H3

This is a technique I saw on a YouTube Video just yesterday, and thought it might be relevant here. Even if it's not, it's an interesting technique!
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,375
Members
448,888
Latest member
Arle8907

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