0% found this document useful (0 votes)
136 views20 pages

MAIAD Lab 01 - Student Guide

The document provides instructions for a lab on using Power Query in Excel. It outlines prerequisites for the lab, the structure of the document and exercises. The exercises cover connecting to CSV and XLSX data sources, transforming data by splitting columns, unpivoting data and data cleaning.

Uploaded by

Dat Nguyen Hoang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views20 pages

MAIAD Lab 01 - Student Guide

The document provides instructions for a lab on using Power Query in Excel. It outlines prerequisites for the lab, the structure of the document and exercises. The exercises cover connecting to CSV and XLSX data sources, transforming data by splitting columns, unpivoting data and data cleaning.

Uploaded by

Dat Nguyen Hoang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Modern Excel

Analyst in a Day

Lab 01

Analytics in Excel – Using


Power Query In Excel

© 2021 Microsoft. All rights reserved.


Lab Prerequisites
The following prerequisites and setup must be complete for successful completion of the
exercises:

• You must be connected to the internet.


• You must have Microsoft Office installed.
• Signup for Power BI: Go to https://aka.ms/pbimaiadtraining
• At minimum, a computer with 2-cores and 4GB RAM running one of the following versions of
Windows: Windows 8 / Windows Server 2008 R2, or later.
• If you chose to use Internet Explorer it will require version 10 or greater, you can also use Edge
or Chrome.
• Verify if you have 32-bit or 64-bit operating system to decide if you need to install the 32-bit or
64-bit applications. Note: 64-bit Excel & Power BI Desktop is best.
• Download the Attendee Content: Create a folder called MAIAD on the C:\ drive of your local
machine. Copy all content from the folder called MAIAD\Attendee to the MAIAD folder you
just created (C:\MAIAD).
• Download and install Power BI Desktop using any one of the options listed below:
o If you have Windows 10, use Microsoft App Store to download and install Power BI
Desktop application.
o Download and install Microsoft Power BI Desktop from https://www.microsoft.com/en-
us/download/details.aspx?id=45331.
o If you already have Power BI Desktop installed, ensure you have the latest version of
Power BI downloaded.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 2
Document Structure
Source Data or Starting Files for each Lab are located within each Lab folder.

• Lab 01 is completed using Power Query in the Excel application.


• Lab 02A & Lab 02B are completed using Power BI Desktop application.
• Lab 03A is completed using Power BI Desktop, Power BI service and Excel applications.
• Lab 03B is completed using Excel & Power BI service applications.

Each of the Labs come with step-by-step instructions to be followed and contain screen images
throughout the instructions. The key actions for each of the steps are identified by underlined text.
Pay attention to Notes, Tips, and other Important information indicated by red font. Lastly, each Lab
contains a completed solution file that can be used as a reference.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 3
Overview
The estimated time to complete this lab is 30 minutes.

In this lab, you will complete the following tasks:

1. Use Power Query to connect to a CSV source data file – Customers


2. Use Power Query transformations to Split Column by Delimiter – Customers
3. Use Power Query to connect to a XLSX source data file – Quotes
4. Use Power Query transformations to Unpivot – Quotes
5. Use Power Query transformations to Clean – Quotes

NOTE: This lab has been created based on the sales activities of the fictitious Wi-Fi company called
SureWi which has been provided by P3 Adaptive https://p3adaptive.com/. The data is property of P3
Adaptive and has been shared with the purpose of demonstrating Excel and Power BI functionality
with industry sample data. Any use of this data must include this attribution to P3 Adaptive.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 4
Exercise 1: Use Power Query to connect
to CSV – Customers.csv
In this exercise, you will use Excel to connect to a CSV source data file.

Task 1: Launch Excel

In this task, you will launch a new blank worksheet to get started.

1. Launch Excel.

2. Create a new blank workbook.

Task 2: Use Power Query to connect to CSV

In this task, you will connect to the Customers CSV source data file.

3. Select the Data tab on the Main Excel ribbon.

4. Choose Get Data > From File > FromText/CSV.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 5
5. Navigate to the file <CourseFolder>\Attendee\Lab Materials\Lab 01\MAIAD Lab 01 - Data
Source - Customers.csv.

6. In the Preview area, you will see a sample of the Customers data: column names and values.

Note: This is ONLY a preview of the data.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 6
7. Select the Transform Data button. This will launch the Power Query Editor window.

Note: When working in Power Query, it is best to maximize the Power Query Editor window – so that
you can see a full view of the Power Query window menus, panes, and options.

8. By default, the Queries Pane on the left-hand side of the Power Query Editor Window will be
collapsed. Click on the arrow in the Queries pane to expand and open the Queries pane.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 7
9. In the Queries Pane, right click on the default query name called “MAIAD Lab 01 - Data Source -
Customers” to Rename the Query to “Customers”.

Tip: Queries that will be loaded to use as part of a Data Model should be given a clear, descriptive,
user-friendly, noun name that describes what the data represents. For example, Customers, Quotes,
Invoices, Products, Geography etc.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 8
Exercise 2: Use Power Query
transformations to Split Column by
Delimiter – Customers
In this exercise, you will use Power Query to extract the First Name from the Contact column.

Task 1: Use Column from Example

In this task, you will create a new column called [First Name] using the Add Column > Column from
Example transformation to split the [Contact] by a delimiter.

10. From the Preview grid, select the [Contacts] column.

11. Then choose from the Add Column Tab, the Columns from Examples down arrow and the From
Selection option.

Note: This opens a NEW user interface window called “Add Columns From Examples” – this window
looks like the Power Query Preview grid, but it is separate window allowing you to type in the
proposed value so that Power Query can identify the pattern and formula to apply achieving the end
results.

12. In the “Add Column From Examples” window, in the column called [Column1], type the value
“Hugo” and then enter.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 9
NOTE: Ince you hit enter, Power Query will then identify if a pattern exists in the data to populate
the values for all rows!

13. Double click in the default header called “Text Before Delimiter” and rename the new column as
“First Name”. Select the OK button.

NOTE: Now, in the Power Query Editor preview grid, you will notice the NEW column called [First
Name] – created by parsing out the [First Name] from the [Contact] using the Column from
Example transformation!

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 10
Exercise 3: Use Power Query to connect
to XLSX – Quotes.xlsx
In this exercise, you will use Excel to connect to a XLSX source data file.

Task 1: Connect to XLSX source data from within the Power Query Editor window

In this task, you will start from within the Power Query Editor window.

14. From the Power Query Home menu, select the New Source > Excel file option.

15. Navigate to the file <CourseFolder>\Attendee\Lab Materials\Lab 01\MAIAD Lab 01 - Data


Source - Quotes.xlsx.

16. In the Navigator window, select the worksheet called “Lab 01 – Quotes”.

Note: This is ONLY a preview of the data.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 11
17. Select the OK button to load as a second query in the Power Query Editor window.

18. In the Queries Pane, right click on the default query name called “Lab 01 - Quotes” to Rename the
Query to “Quotes”.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 12
Exercise 4: Use Power Query to Unpivot
- Quotes
In this exercise, you will use Power Query transformations to structure the Quotes data for Power Pivot.

Task 1: Use First Row as Headers transformation button

In this task, you will move the first row with the column header values to the table header.

19. On the Home menu, select the Use First Row as Headers button.

Task 2: Use the Unpivot transformation menu option

In this task, you will now unpivot the Quotes data.

20. In the Preview Pane, use a right click on the [CustID] column to display menu options.

21. Then choose the Unpivot Other Columns option.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 13
22. Double-click on the column called [Attribute] to rename the column to [QuoteDate].

23. Double-click on the column called [Value] to rename the column to [QuoteAmt].

Before

After

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 14
Exercise 5: Use Power Query to Clean -
Quotes
In this exercise, you will use Power Query transformations to Clean the Quotes data.

Task 1: Use the Replace transformation

In this task, you will use a replace technique to change the [QuoteDate] a full date that can be
converted to a Date data type.

24. In the Preview window, use a right click on the [QuoteDate] column to display menu options.

25. Next, choose the Replace Values… option.

26. In the Replace Values… UI window:

27. Enter a hyphen “–“ in the Value To Find text box.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 15
28. Enter “/1/” in the Replace With text box.

29. Select the OK button.

Task 2: Use the Data Type icon

In this task, you will use the Data Type icon to change the data type from Text to Date.

30. Click on the ABC icon that indicated the column is a Text data type.

31. Then choose the Date data type option from the data type menu options.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 16
Task 3: Close & Load to the Data Model

In this task, you will load the Customers and Quotes tables to the Data Model.

32. From the Home menu select > Close & Load > Close & Load To…

33. On the Import window, select the Only Create Connection radio button.

34. And check the box next to Add this data to the Data Model.

35. Select the OK button.

Note: The loaded Tables will be displayed in the Queries & Connections Pane window with total
number of rows loaded.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 17
Note: At the point, we have connected to the data sources using Power Query and we have selected
the checkbox option to Add this data to the Data Model. However, we have not actually seen where
this data has been loaded to. In the next Lab 02A, we will use Power BI Desktop to Import the Power
Query connections, Customer table, and Quote table – to create the Data Model.

Task 4: Save the File

In this task, you will save the Excel file with the Customers and Quotes query connections.

36. From the Main Excel ribbon, select File > Save.

37. Navigate to the folder <CourseFolder>\Attendee\Lab Materials\Lab 01\ and then save the file
as “MAIAD Lab 01 – My Solution.xlsx”.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 18
Summary
In this lab, you used Power Query in Excel to connect to CSV & XLSX source data files, created a new
column using Column from Example, unpivoted & applied transformations in Power Query, loaded
source data to a Data Model and Save the Excel file with the data connections.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 19
Terms of Use
© 2021 Microsoft. All rights reserved.

By using this hands-on lab, you agree to the following terms:

The technology/functionality described in this hands-on lab is provided by Microsoft Corporation in a


“sandbox” testing environment for purposes of obtaining your feedback and to provide you with a
learning experience. You may only use the hands-on lab to evaluate such technology features and
functionality and provide feedback to Microsoft. You may not use it for any other purpose. Without
written permission, you may not modify, copy, distribute, transmit, display, perform, reproduce,
publish, license, create derivative works from, transfer, or sell this hands-on lab or any portion thereof.

COPYING OR REPRODUCTION OF THE HANDS-ON LAB (OR ANY PORTION OF IT) TO ANY OTHER
SERVER OR LOCATION FOR FURTHER REPRODUCTION OR REDISTRIBUTION WITHOUT WRITTEN
PERMISSION IS EXPRESSLY PROHIBITED.

THIS HANDS-ON LAB PROVIDES CERTAIN SOFTWARE TECHNOLOGY/PRODUCT FEATURES AND


FUNCTIONALITY, INCLUDING POTENTIAL NEW FEATURES AND CONCEPTS, IN A SIMULATED
ENVIRONMENT WITHOUT COMPLEX SET-UP OR INSTALLATION FOR THE PURPOSE DESCRIBED
ABOVE. THE TECHNOLOGY/CONCEPTS REPRESENTED IN THIS HANDS-ON LAB MAY NOT REPRESENT
FULL FEATURE FUNCTIONALITY AND MAY NOT WORK THE WAY A FINAL VERSION MAY WORK. WE
ALSO MAY NOT RELEASE A FINAL VERSION OF SUCH FEATURES OR CONCEPTS. YOUR EXPERIENCE
WITH USING SUCH FEATURES AND FUNCITONALITY IN A PHYSICAL ENVIRONMENT MAY ALSO BE
DIFFERENT.

FEEDBACK If you give feedback about the technology features, functionality and/or concepts
described in this hands-on lab to Microsoft, you give to Microsoft, without charge, the right to use,
share and commercialize your feedback in any way and for any purpose. You also give to third parties,
without charge, any patent rights needed for their products, technologies and services to use or
interface with any specific parts of a Microsoft software or service that includes the feedback. You will
not give feedback that is subject to a license that requires Microsoft to license its software or
documentation to third parties because we include your feedback in them. These rights survive this
agreement.

MICROSOFT CORPORATION HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS WITH REGARD
TO THE HANDS-ON LAB, INCLUDING ALL WARRANTIES AND CONDITIONS OF MERCHANTABILITY,
WHETHER EXPRESS, IMPLIED OR STATUTORY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. MICROSOFT DOES NOT MAKE ANY ASSURANCES OR REPRESENTATIONS WITH
REGARD TO THE ACCURACY OF THE RESULTS, OUTPUT THAT DERIVES FROM USE OF THE VIRTUAL
LAB, OR SUITABILITY OF THE INFORMATION CONTAINED IN THE VIRTUAL LAB FOR ANY PURPOSE.

DISCLAIMER This lab contains only a portion of new features and enhancements in Microsoft Power
BI. Some of the features might change in future releases of the product.

Power BI Modern Excel Analyst in a day: Lab 01 202101© 2021 Microsoft. All rights reserved. 20

You might also like