• 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

Power Query. Group Rows Based on Periods and Insert a Calculated Row. Please See Example.|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Power Query. Group Rows Based on Periods and Insert a Calculated Row. Please See Example.|Power Query|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 QueryPower Query. Group Rows Based on Pe…
sp_PrintTopic sp_TopicIcon
Power Query. Group Rows Based on Periods and Insert a Calculated Row. Please See Example.
Avatar
Alien on the run

New Member
Members
Level 0
Forum Posts: 2
Member Since:
October 16, 2021
sp_UserOfflineSmall Offline
1
October 16, 2021 - 3:23 am
sp_Permalink sp_Print

Hi

 

Below is a short sample of a large dataset and what I am trying to achieve.

 

Thanks for any help on this.

 

Dataset 1                      
Period  Id    Name     Gross Pay     Overtime                   
1          1      John       1,000            100.00                
1          2      Patrick    3,000              50.00                
                         
                         
Dataset 2                      
Period  Id    Name     Gross Pay     Overtime                   
2          1      John       2,000            100.00                
2          2      Patrick    4,500              50.00                
                         
Aim is to bring these two periods together on Power Query and obtain the otpout below (I can do this in Crystal Reports easily).
                         
Period  Id    Name     Gross Pay     Overtime                   
1          1      John       1,000            100.00                
2          1      John       2,000            100.00                
Totas                          3,000            200.00                
                         
Period  Id    Name     Gross Pay     Overtime                 
1          2      Patrick    2,000              50.00                
2          2      Patrick    4,500              50.00                
Totals                         6,500            100.00                      
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4447
Member Since:
July 16, 2010
sp_UserOnlineSmall Online
2
October 18, 2021 - 10:18 am
sp_Permalink sp_Print

Hi and welcome to our forum!

It's always best if you can attach an Excel file so we can give you a file back with a completed solution as we don't have time to recreate the file for you.

You can certainly combine the two datasets and then the correct way to achieve the end result is to use a PivotTable to extract the data into reports for each person.

It's not clear if the two data sets are in separate files or the same file so I've listed two tutorials below:

- Combine datasets from different sheets in the same file with Power Query

- Combine datasets from separate files with Power Query

If you'd like to learn Power Query, please consider my Power Query course.

Mynda

Avatar
Alien on the run

New Member
Members
Level 0
Forum Posts: 2
Member Since:
October 16, 2021
sp_UserOfflineSmall Offline
3
November 3, 2021 - 6:20 am
sp_Permalink sp_Print

Mynda, thank you for your reply.

Please see sample file attached with expected outcome. Please open the second file, I can't figure out how to delete the first file - incomplete.

As I said, easily done on Crystal Reports. I though I could do the same on Power Query without too much fuss.

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4447
Member Since:
July 16, 2010
sp_UserOnlineSmall Online
4
November 3, 2021 - 9:20 am
sp_Permalink sp_Print

Looks like this question isn't about combining datasets as the sample file already has the dataset combined. Rather, it's about extracting data into a report format.

In the attached file you'll see two options:

1. In cell H1 is a PivotTable that calculates the difference from one period to the next using 'Show Values as' > Difference From > Pay Period, Previous.

2. In cell H24 is a PivotTable that calculates the variance using calculated items. The limitation of this is you can't include the ID number in the PivotTable without it affecting the layout.

Please follow the links for more instructions on how to build these solutions.

Mynda

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Mynda Treacy, s Ramchandran, Shanna Henseler, Stacy Culpepper
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:
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Ray-Yu Yang
George Shihadeh
Naomi Rumble
Uwe von Gostomski
Jonathan Jones
drsven
Forum Stats:
Groups: 3
Forums: 24
Topics: 6212
Posts: 27237

 

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