• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • SALE 20% Off All Courses
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Filter a Pivot Table field by "Bottom 10 that are greater than 0"|Power Pivot|Excel Forum|My Online Training Hub

You are here: Home / Filter a Pivot Table field by "Bottom 10 that are greater than 0"|Power Pivot|Excel Forum|My Online Training Hub
                    BLACK FRIDAY SALE 20% OFF ALL COURSES
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower PivotFilter a Pivot Table field by "Bott…
sp_PrintTopic sp_TopicIcon
Filter a Pivot Table field by "Bottom 10 that are greater than 0"
Avatar
Charles Johnson
Borneo
Member
Members
Level 0
Forum Posts: 14
Member Since:
April 25, 2020
sp_UserOfflineSmall Offline
1
November 18, 2023 - 7:55 pm
sp_Permalink sp_Print

I have a pivot Bar chart that is created from a pivot table which is created in Power Query and added to the data model.

The pivot table has just 2 columns "Item Name" as Rows and "Total Items sold" as a value.

I need to filter Total Items Sold for Greater than 0 AND get the bottom 10 of the result of the first filter.

I have tried enabling "Allow multiple filters for a field" but that does not work (the Greater Than filter is still cleared before the Bottom 10 gets filtered).

I can't do this in PQ because the user needs to choose whether or no to exclude the zero values from the Bottom 10 filter.

Any help or suggestions greatly appreciated. TIA

sp_AnswersTopicSeeAnswer See Answer
Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators
Level 1
Forum Posts: 688
Member Since:
January 31, 2022
sp_UserOfflineSmall Offline
2
November 18, 2023 - 10:29 pm
sp_Permalink sp_Print

Please upload a file (exclude any confidential information) so that we can see what exactly you are dealing with.

Avatar
Charles Johnson
Borneo
Member
Members
Level 0
Forum Posts: 14
Member Since:
April 25, 2020
sp_UserOfflineSmall Offline
3
November 18, 2023 - 11:21 pm
sp_Permalink sp_Print

The actual file pulls data from 10 other csv files in different folders. It also contains many PQs, I think it would be better if I was to create a separate file that replicates the issue.

Avatar
Charles Johnson
Borneo
Member
Members
Level 0
Forum Posts: 14
Member Since:
April 25, 2020
sp_UserOfflineSmall Offline
4
November 19, 2023 - 1:23 am
sp_Permalink sp_Print

Here is the sample file.

Data is in a Table rather than CSV files. There are just 4 Events and 30 Items as opposed to the real situation that is up to 35 Events over 5 years and approximately 900 Items per Event (not all events will have exactly the same Items.

Just 1 Slicer for Event and buttons to control filtering. In the actual file there are additional slicers for Category (Items are in different Categories) and Year plus button for Top 10 (that does not need zeros omitting).

I loaded the Table into PQ then loaded it back to the sheet as a Pivot Table and added that to the Data Model so all that is consistent with the actual file.

Thanks

Avatar
Charles Johnson
Borneo
Member
Members
Level 0
Forum Posts: 14
Member Since:
April 25, 2020
sp_UserOfflineSmall Offline
5
November 19, 2023 - 1:41 am
sp_Permalink sp_Print

Sorry uploaded an unfinished Sample File. Here is the finished version.

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 721
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
6
November 20, 2023 - 9:18 pm
sp_Permalink sp_Print

You could create a measure called ItemsSoldNoZero with the formula:

=if([Sum of Items sold]=0,blank(),[Sum of Items sold])

 

Then amend your button code to:

Sub Button3_Click()
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Table1].[Item Name].[Item Name]").ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Table1].[Item Name].[Item Name]").PivotFilters.Add2 Type:=xlBottomCount, _
DataField:=ActiveSheet.PivotTables("PivotTable1").CubeFields( _
"[Measures].[ItemsSoldNoZero]"), Value1:=10
End Sub

sp_AnswersTopicAnswer
Answers Post
Avatar
Charles Johnson
Borneo
Member
Members
Level 0
Forum Posts: 14
Member Since:
April 25, 2020
sp_UserOfflineSmall Offline
7
November 22, 2023 - 6:51 am
sp_Permalink sp_Print

Thanks.

That works. It does add an additional bar to the chart which I have to make invisible.

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 721
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
8
November 22, 2023 - 8:25 pm
sp_Permalink sp_Print

You shouldn't need that measure actually in the chart at all.

Avatar
Charles Johnson
Borneo
Member
Members
Level 0
Forum Posts: 14
Member Since:
April 25, 2020
sp_UserOfflineSmall Offline
9
November 23, 2023 - 8:39 pm
sp_Permalink sp_Print

You are right, of course. Thanks

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Tony Brett
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Catalin Bombea: 1864
SunnyKow: 1432
Anders Sehlstedt: 886
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 241
Hans Hallebeek: 222
Jessica Stewart: 219
A.Maurizio: 213
Newest Members:
Agnes Welch
ANTONIO FERNANDEZ FLORO
Arisa Atajewa
Tony Brett
Martha Hennen
Gweneth Henderson
EDWARD JAMES
Ashley Williams
Brian Sutera
Marc Frappier
Forum Stats:
Groups: 3
Forums: 24
Topics: 6638
Posts: 29118

 

Member Stats:
Guest Posters: 49
Members: 33064
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk – For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.