+ Reply to Thread
Results 1 to 9 of 9

Power Pivot - grouping timestamps by hour is not in incremental order

  1. #1
    Forum Contributor
    Join Date
    09-05-2019
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    101

    Power Pivot - grouping timestamps by hour is not in incremental order

    Hello

    When I have had the occasional success in grouping timestamps in a Power Pivot table, I typically group it based on hour and day. However, grouping the timestamps by hour will not be sorted in incremental order. This is a little strange, but whenever I ungroup, it is sorted in the correct order.

    I have had it occured with multiple different csv files, so it isn't unique to a particular file.

    What could be the cause of this and is there anyway to fix this?

    Thanks

    Edit: Added the individual files as needed. Since there might be a possibility that I might be doing something wrong in the Power Query, I have also attached the csv that I have been using.
    Attached Files Attached Files
    Last edited by dcwan; 08-13-2020 at 02:40 PM.

  2. #2
    Forum Contributor
    Join Date
    09-05-2019
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    101

    Re: Power Pivot - grouping timestamps by hour is not in incremental order

    Hello

    I was wondering whether I'm not getting help is due to my infractions.

    Thank you

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Power Pivot - grouping timestamps by hour is not in incremental order

    No, but I am not gonna use a zip file.

    So if you add a small excel file I can take a look at it.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Contributor
    Join Date
    09-05-2019
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    101

    Re: Power Pivot - grouping timestamps by hour is not in incremental order

    Hello

    I have updated the original post so that you wouldn't need to download the zip files.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Power Pivot - grouping timestamps by hour is not in incremental order

    I've I create a pivot table from the CSV file I can group by day and hour and everything seems correctly sorted, see the attached workbook.
    Attached Files Attached Files
    If posting code please use code tags, see here.

  6. #6
    Forum Contributor
    Join Date
    09-05-2019
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    101

    Re: Power Pivot - grouping timestamps by hour is not in incremental order

    Hello Norie

    The sample workbook is not using a Power Pivot table. Since my scenario is data that is from a Power Pivot connection, it would not be an apples to apples comparison. The reason why I mention the Power Pivot table is that if I "load [data] to" table, and make a Pivot table from it, then the hour is incrementally sorted. However, if I'm using a Power Pivot table, my Power Pivot table doesn't sort hours correctly.

    Thanks

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Power Pivot - grouping timestamps by hour is not in incremental order

    What steps are you following to group the data in Power Pivot?

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Power Pivot - grouping timestamps by hour is not in incremental order

    If you open Power Pivot after you have grouped the data you should see that the formula for the 'hour' column is using the TEXT function which returns text that's why the data isn't sorting correctly.

    Change the formula in that column to use HOUR to extract the numeric hour.
    Last edited by Norie; 08-17-2020 at 06:29 PM.

  9. #9
    Forum Contributor
    Join Date
    09-05-2019
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    101

    Re: Power Pivot - grouping timestamps by hour is not in incremental order

    Hello Norie

    These are the steps that I do:

    1) Check "Load to" Pivot Table, uncheck "Add this data to Data Model"
    2) Put the different variables in the appropriate places ("Timestamp" in rows, "Values in values)
    3) Ungroup the Row labels to ensure that I get date/timestamp
    4) Check to see whether the format (Date) is correct
    5) Group by Hour/Day

    Apparently when I redid it for my sample data it worked, but it doesn't seem to be consistent. Are there any additional steps I need to do?

    Thanks

+ 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. Replies: 6
    Last Post: 08-24-2020, 12:34 PM
  2. Replies: 3
    Last Post: 08-10-2020, 11:38 AM
  3. Incremental refresh in Power Query / Get & Transform
    By SHI.NL in forum Excel General
    Replies: 1
    Last Post: 09-17-2019, 05:34 AM
  4. 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
  5. [SOLVED] Grouping Dates in Power Pivot
    By kersplash in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-15-2018, 09:57 PM
  6. Automation sheet- Power Hour
    By Pranav9940 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-05-2013, 04:49 AM
  7. [SOLVED] How do I create incremental numbers on an order form?
    By Mark in forum Excel General
    Replies: 4
    Last Post: 07-05-2005, 09:05 PM

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