+ Reply to Thread
Results 1 to 6 of 6

Power Query Sorting by Date not sorting correctly

  1. #1
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Power Query Sorting by Date not sorting correctly

    I have a strange problem I can't seem to figure out.
    In the first image is the loaded output of my Power Query query with the ApptDate sorted from oldest to newest. The sort has been manually applied on the column.

    Capture1.JPG

    In the second image is the preview of the query in the preview window that pops up when you hover over the query.

    Capture2.JPG

    In the final image is when I refresh the loaded table which should replicate the first image, but it doesn't.
    You can even see the sort indicator at the top of the column remains.

    Capture3.JPG

    I have to manually sort the column again to get it to look like the first image.
    Any ideas before I go stripping my file back to share?
    Last edited by kersplash; 08-20-2018 at 02:40 AM. Reason: modified thread title

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Power Query Sorting by Date not sorting correctly

    Ah - funny, but I had something like this myself the other day.

    What you have to do is clear all filters from the table in Excel in order that the PQ filter settings carry through to it. I'm not sure if tweaking the table's external data properties will make any difference.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Power Query Sorting by Date not sorting correctly

    But I only have the sort on that date column to begin with and then the query seems to override that with some random layout.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Power Query Sorting by Date not sorting correctly

    OK - let's have a look at a sample file, then.

  5. #5
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Power Query Sorting by Date not sorting correctly

    You were right, it was in the Table External Data Properties.

    I thought I had checked that, but obviously didn't.

    The preserve column sort/filter/layout checkbox needs to be checked AND the required column must be sorted already (otherwise that old sort will take precedence over the query sort).

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Power Query Sorting by Date not sorting correctly

    That setting is selected automatically now in the 365 version. The issue I had was at work, where we have the desktop version.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  2. [SOLVED] power query date format
    By orhanceliloglu in forum Excel General
    Replies: 3
    Last Post: 06-18-2018, 08:08 AM
  3. [SOLVED] Power Query URL by date
    By jespo1351 in forum Excel General
    Replies: 11
    Last Post: 05-22-2018, 01:37 PM
  4. [SOLVED] Insert a date value as a Custom Column in Power Query
    By heytherejem in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-28-2018, 12:42 PM
  5. [SOLVED] Power Query Date Transformation
    By Moggzzz in forum Excel General
    Replies: 2
    Last Post: 03-21-2018, 02:47 PM
  6. Power Query Date Time
    By jcmckeon in forum Excel General
    Replies: 5
    Last Post: 09-12-2017, 02:19 PM
  7. Power Query - Filter by Date
    By brent_milne in forum Excel General
    Replies: 0
    Last Post: 03-16-2017, 10:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1