• 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

Pivot table manual sort when using data model|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Pivot table manual sort when using data model|General Excel Questions & Answers|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 ForumGeneral Excel Questions & Answe…Pivot table manual sort when using …
sp_PrintTopic sp_TopicIcon
Pivot table manual sort when using data model
Avatar
baxbax
Member
Members

Power Query

Power Pivot
Level 0
Forum Posts: 105
Member Since:
July 11, 2016
sp_UserOfflineSmall Offline
1
October 29, 2021 - 2:31 am
sp_Permalink sp_Print

Hi,

I have a pivot table that I want to apply a manual sort to. I have done this but the issue is that every time the table is updated then the manual sort is lost. I have tried clicking/unclicking all options I know of that relate to the sort, pivot table options - use custom lists when sorting, More sort options - Sort automatically every time the report is updated, but they have no effect.

It seems that the issue relates to the fact that the pivot table is using the data model to get the data. I have attached a file that shows examples of a pivot using the data model and one that doesn't. In the file I have manually sorted both pivots on the Product Class column in the order D,B,A,C. If you then filter the pivots either using the column filter or the slicers then remove the filters you will see that the one using the data model re-sorts as A,B,C,D whereas the other one retains the manual sort.

Does anyone know how to resolve this?

Thanks

Bax

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
2
October 29, 2021 - 7:42 am
sp_Permalink sp_Print

Hello,

There are good support articles at Microsoft, for example this one about sorting data in PivotTables or -Charts.
At the bottom of the page you will find following info:

Note: A custom list sort order is not retained when you update (refresh) data in your PivotTable.

You can always add an index column to your data table where you set values which can be used to sort by in the PivotTable.

Br,
Anders

Avatar
baxbax
Member
Members

Power Query

Power Pivot
Level 0
Forum Posts: 105
Member Since:
July 11, 2016
sp_UserOfflineSmall Offline
3
October 29, 2021 - 9:52 pm
sp_Permalink sp_Print

Hi Anders,

Thanks for the reply. Unfortunately I don't control the report that the pivot is in and therefore can't add an index to it. I am more interested in why the sort results work differently for pivots from a data model and those not from the model.

Regards

 

Bax

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
4
October 30, 2021 - 7:33 pm
sp_Permalink sp_Print

Hello again,

Well, I can't find any explanation to why it behaves like that.
Seems that a regular PivotTable is the better option if you want to have and retain manual sort order.

Br,
Anders

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4443
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
5
October 30, 2021 - 7:55 pm
sp_Permalink sp_Print

Hi Bax,

The data model can't access custom lists, therefore you add a sort order to the data model and set the 'sort by' column in there.

Mynda

Avatar
baxbax
Member
Members

Power Query

Power Pivot
Level 0
Forum Posts: 105
Member Since:
July 11, 2016
sp_UserOfflineSmall Offline
6
November 3, 2021 - 2:39 am
sp_Permalink sp_Print

Hi Mynda,

I have had a look at the options in the data model and I can't see where you would add the sort order. Can you help?

Thanks

 

Bax

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4443
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
7
November 3, 2021 - 9:00 am
sp_Permalink sp_Print

Hi Bax,

Please see this tutorial on how to sort by columns in Power BI.

Mynda

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Philip Treacy, Carlos Ferreira, Chandler Davis, baber Tufail
Guest(s) 8
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:
drsven
Annie Witbrod
wahab tunde
Cong Le Duc
Faisal Bashir
Ivica Cvetkovski
Blaine Cox
Shankar Srinivasan
riyepa fdgf
Hannah Cave
Forum Stats:
Groups: 3
Forums: 24
Topics: 6205
Posts: 27211

 

Member Stats:
Guest Posters: 49
Members: 31880
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.