215|EXCEL – Powering Up PowerQuery

Kyle_Nilsen
Tue, 14 May 2024 19:31:09 +0000
Challenges

BYU Student Author: @Kyle_Nilsen
Reviewers: @Marta_Ellsworth, @Jacob_Dutton
Estimated Time to Solve: 15 Minutes

This challenge was written in partnership with a business professional. The data, scenario, or both were inspired by real-world business scenarios.

We provide the solution to this challenge using:

Excel

Need a program? Click here.

Overview
You are a new associate at a local accounting firm. One of your clients has requested assistance with a project aimed at analyzing and evaluating transactions processed through one of their third-party software, Stripe. The transaction list is given to you in an Excel file, but it contains both logic and syntax errors. However, the client wants to ensure the original data is preserved and not modified in any way. To work around this, you will need to use PowerQuery and PivotTables. PowerQuery is an especially useful tool as it records and displays each step taken to modify the original data source so that your work can be reproduced. Or, if the original data is modified, the query will automatically update to reflect the changes. Your task is ultimately to present a clean, professional, summarized view of these transactions to your client.

Instructions

1. Download the Challenge215_Powering_Up_PowerQuery Excel file included at the bottom of the challenge.

2. Create a new Excel workbook in order to use power query. Import the Challenge215_Powering_Up_PowerQuery file and then open the query editor.

3. This step focuses on cleaning and preparing the data within the query editor.
a. There are several errors within the data that will prevent aggregation functions being used later on. Delete all rows in the gross, fee, and net columns that have errors.
b. The data has some blank rows resulting from different export times. Remove all blank rows.
c. There is an error in the fees column: every record which falls under the “dispute” category has its “fee” value set to 2, which is actually an internal ID. It is meant to be a static value, 17. Change every occurrence of the value 2 in the “fee” column to 17.
d. Group the data by customer (“automatic_payout_id”) and “reporting_category” to find the total number of transactions and the totals of the “gross”, “fee”, and “net” columns.
e. Close and load the query into your Excel workbook.

4. Now you have a query presenting some good, clean data. However, it is not easy to read for quick analysis with totals and subtotals per customer. Use the query you just created to create two PivotTables.
a. The first PivotTable should consist of the totals for each “reporting_category” for “gross,” “fee,” and “net.” Also include a count of total records for each category.
b. The second PivotTable will be similar to the first, but it should break out the totals across each customer (“automatic_payout_id”). In other words, there should be subtotals for each customer, and then beneath that subtotal, break out the subtotals for each “reporting_category.”

Data Files

Challenge215_Powering_Up_PowerQuery.xslx

Suggestions and Hints (click for more details)
Solution

spoiler

44 posts - 43 participants

Read full topic