+ Reply to Thread
Results 1 to 2 of 2

Pivot or Group - Power Query

  1. #1
    Registered User
    Join Date
    07-26-2023
    Location
    Australia
    MS-Off Ver
    365
    Posts
    20

    Pivot or Group - Power Query

    Pivot/unpivot or group!

    Hi All



    I have a data set that spits out and I know I can either use grouping or pivoting but I am stuck



    Table 1 products.

    Comes out like this;

    SubmissionID EntryID Product Field Column Value
    123 3500 Apples Bin 0
    123 3501 Apples Quantity 0 35
    123 3502 Apples Bin 1
    123 3503 Apples Quantity 1 109
    123 3504 Apples Bin 2
    123 3505 Apples Quantity 2 144


    i need to look like this

    SubmissionID Product Bin Quantity Kilos
    123 Apples 36 2210
    123 Bananas 12 2280





    Table 2

    FORM ID EntryID Name Value
    123 3486 Date out 11/26/2024 00:00:00
    123 3487 DateIn 9/11/2024 0:00
    123 3488 ReceivalNo 999999
    123 3489 ID 1
    123 3490 Name Lisa
    123 3491 Location Action
    123 3492 Test Test
    123 3493 Size
    123 3494 Comment


    Need to reformat to;



    FORM ID Date out DateIn ReceivalNo ID Name Location Test Size Comment
    123 11/26/2024 00:00:00 9/11/2024 0:00 999999 1 Lisa Action Test







    Table 3

    SubmissionID EntryID Index Group RowType Column Value
    123 3495 0 People TableFieldEntry LaborType Supervisor
    123 3496 0 People TableFieldEntry Name TEST
    123 3497 0 People TableFieldEntry Number of People 1
    123 3498 0 People TableFieldEntry Start 11/26/2024 02:45:00
    123 3499 0 People TableFieldEntry Finish 11/26/2024 07:00:00
    123 3538 1 People TableFieldEntry LaborType Supervisor




    Outcome

    SubmissionID LaborType Name Number of People Start Finish
    123 Supervisor TEST 1 11/26/2024 02:45:00 11/26/2024 07:00:00
    123 Supervisor TEST 1 11/26/2024 02:45:00 11/26/2024 07:00:00



    Can someone assist kindly
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,961

    Re: Pivot or Group - Power Query

    As to Table 1 products, this Power Pivot based proposal may need to be modified, however it seems to me that the values under Bin should only come from the rows marked Bin in the Field column.
    1. Convert the range in A1:F111 on the Products sheet into an Excel table
    2. Add the table to the data model
    3. Add the following measures
    _Bin:=CALCULATE(SUM(Table1[Column]),Table1[Field]="Bin")
    _Quantity:=CALCULATE(SUM(Table1[Value]),Table1[Field]="Quantity")
    _Kilos:=CALCULATE(SUM(Table1[Value]),Table1[Field]="Kilos")
    4. Produce a pivot table from the data model
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. [SOLVED] Why is my Excel file so big even though I uploaded the data using Power Pivot/Power Query?
    By Olivia Ludwig in forum Excel Charting & Pivots
    Replies: 12
    Last Post: 09-21-2023, 05:18 AM
  2. [SOLVED] Power Query Group and select rows within group
    By Dicken in forum Office 365
    Replies: 2
    Last Post: 06-10-2023, 07:51 AM
  3. Replies: 2
    Last Post: 12-17-2021, 08:41 AM
  4. [SOLVED] Power Query/Power Pivot Conditional Column creation & chart
    By mz_h in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-12-2020, 06:07 PM
  5. [SOLVED] 2 fields checker- Request for alternative option in Power Query or Power Pivot
    By Shareez Saleem in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2020, 08:36 AM
  6. Replies: 6
    Last Post: 08-24-2020, 12:34 PM
  7. 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

Tags for this Thread

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