• 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
    • 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

RANKX function within Power Pivot|Power Pivot|Excel Forum|My Online Training Hub

You are here: Home / RANKX function within Power Pivot|Power Pivot|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
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 PivotRANKX function within Power Pivot
sp_PrintTopic sp_TopicIcon
RANKX function within Power Pivot
Avatar
Gary
Member
Members
Level 0
Forum Posts: 8
Member Since:
February 3, 2021
sp_UserOfflineSmall Offline
1
March 16, 2022 - 6:38 pm
sp_Permalink sp_Print

I have a problem with the RANKX function within Power Pivot. Can anyone help please?

I use this formula within Measures:-

=RANKX(ALL(dbase[Name]),[Sum of Sales])

It works fine within a Pivot table - it ranks Sales people based on their daily sales.

However, I am trying to embed it within the actual dataset with the "Manage" option and then Pivot on the new enhanced data.

It doesn't work! Does anyone know the correct formula to have it within the Manage area please?

Thanks
Gary

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 617
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
2
March 16, 2022 - 10:31 pm
sp_Permalink sp_Print

I presume you mean you are trying to use it in a calculated column? If so, I think we'd need to see the model and know what level you want the ranking done at - e.g. should it always be daily sales, regardless of what aggregation you are looking at in the pivot table(s)?

Avatar
Gary
Member
Members
Level 0
Forum Posts: 8
Member Since:
February 3, 2021
sp_UserOfflineSmall Offline
3
March 18, 2022 - 4:13 am
sp_Permalink sp_Print

Hi - please see attached file. This is purely how Excel would handle it. I have used Countifs to get a rank. I need to be to achieve the same thing in Power Pivot as there is a significant amount of data. You will see the ranking in the excel sheet is based on a unique ID. If the ranking was in the calculation area of PP it would give more flexibility on reporting. 

Thanks
Gary

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 617
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
4
March 18, 2022 - 6:32 pm
sp_Permalink sp_Print

Actually, a calculated column gives you less flexibility since it will always be based on set criteria and not respond to any filters in place on your pivot, unlike a measure (though you can also create a measure to ignore filters).

Anyway, for your example, assuming the table is called Table1, you could use:

=RANKX(filter(Table1,Table1[ID]=earlier(Table1[ID])),Table1[Sales])

Avatar
Gary
Member
Members
Level 0
Forum Posts: 8
Member Since:
February 3, 2021
sp_UserOfflineSmall Offline
5
March 18, 2022 - 7:24 pm
sp_Permalink sp_Print

It works Many thanks for your help!

Avatar
Gary
Member
Members
Level 0
Forum Posts: 8
Member Since:
February 3, 2021
sp_UserOfflineSmall Offline
6
March 19, 2022 - 9:33 pm
sp_Permalink sp_Print

Do you recommend any books or training courses that differentiate Excel formulas with Power Pivot functions?

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
7
March 21, 2022 - 5:26 am
sp_Permalink sp_Print

Hello,

The PQ functions are very well documented in the Power Query M function reference site found online.
Use the information you find there to find what the M functions you need.

Br,
Anders

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 617
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
8
March 21, 2022 - 9:14 am
sp_Permalink sp_Print

Do you recommend any books or training courses that differentiate Excel formulas with Power Pivot functions?

Well, given where we are, I think I'd have to suggest you look at Mynda's Power Pivot courses. 🙂

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
9
March 21, 2022 - 3:55 pm
sp_Permalink sp_Print

Hello again,

And the online DAX reference pages are found here.

Br,
Anders

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Lynnette Altomari, Karolis Kmitas, Roy Lutke, Jeff Krueger, Darrell Hodge, Natasha Smith, Sopi Yuniarti
Guest(s) 11
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Sopi Yuniarti
sandra parker
LAFONSO HERNANDEZ
Hayden Hao
Angela chen
Sean Moore
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Forum Stats:
Groups: 3
Forums: 24
Topics: 6214
Posts: 27243

 

Member Stats:
Guest Posters: 49
Members: 31894
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • 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
 

Company

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

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.