Shaping and Combining Data
Shaping and Combining Data
Shaping and Combining Data
• With the Advanced Editor, you can see the query that
Power BI runs against the data source to import the data:
• Query is written in M Power Query Formula Language
• To view, click Edit Queries to open Query Editor, then
click Advanced Editor from Home, or View tab
• The query includes the connection, and connection
type; for example, Excel or SQL Database
• All transformations you apply to your data using Query
Editor are added to the query code
• The list of Applied Steps are reflected in the query, and
in the same order
• You can edit the query, but use syntax checker
Demonstration: Using Applied Steps
• Table group:
• Use Group By to apply aggregations on your table
• Use First Rows As Headers, and use Headers As First Row
• Transpose to treat columns as rows, and rows as columns
• Reverse Rows to reverse the order of the data
• Any Column group:
• Change data types, or use Detect Data Types
• Replace Values, and Replace Errors
• Fill null values in a column
• Pivot Column and Unpivot Columns
• Move columns
• Split
• Split single column in multiple columns
Demonstration: Transforming Data with the
Query Editor
• Merge columns:
• Merge one table into another table, using a joining
column
• Choose from join types
• All columns are initially merged, but use the selector to
choose which columns you want to keep
• Can retain original column names
• Append rows:
• Adds rows from one or more tables to another table
• Column data does not have to match
• Mismatching can result in unclean data and/or nulls
• Add index to combined table
Demonstration: Adding and Shaping Data from
the Internet
Logon Information
Virtual machine: 10989B-MIA-SQL
User name: ADVENTUREWORKS\Student
Password: Pa$$w0rd
• Review Question(s)