Part 1 - Homework Exercises
Part 1 - Homework Exercises
1) Before continuing to the next section of the course, please check your copy of Excel and confirm
that you have access to Power Query and Power Pivot tools. For compatibility information, Google
"Where is Power Pivot?" or visit support.office.com for the latest information from Microsoft.
2) Make sure that you've downloaded all of the individual CSV files, as well as the solution file if
you’d like to use it for reference. For easy access, I'd recommend placing all course resource files in
a single folder on your desktop.
Using the FoodMart_Data_Model workbook, complete the following steps (Answers below - no
peeking!)
1) Load the Region_Lookup csv file from the course resources, and use the Query Editor to confirm
that region_id is formatted as a whole number and all other columns are formatted as text.
● Add a new column named full_name that merges the first_name and last_name
columns, separated by a space
● Create a new column named birth_year to extract the year from the birthdate column,
and format as text
● Create a conditional column named has_children which equals "N" if total_children = 0,
otherwise "Y". Drag the new column next to total_children and confirm that the values
are populating correctly.
● Close and Load, then check the data model to confirm that the new fields are accessible.
● Use the Query Editor to return the number of distinct product brands in the table. How
many distinct brands are represented? How many distinct product names? Delete these
applied steps and return the table to its original state.
● Find the applied step where we calculated discount_retail_price (product_retail_price *
0.9), and click on the gear icon to edit the step. Adjust the discount from 0.9 to 0.8, then
click through the remaining applied steps to confirm that the updated
discount_retail_price is calculating properly.
● Select the product_brand column and use the Group By option to calculate the average
retail price by product brand (name the new column average_retail_price). Format as
currency and round to two digits. What’s the average retail price for Ship Shape
products? Delete these applied steps to return the table to its pre-grouped state.
● Close and Load, then check the data model to confirm the updated discount_retail_price
values
ANSWERS:
1) Refer to FoodMart_SOLUTION_FILE workbook in the course resources