Introduction to power query

Slides:



Advertisements
Similar presentations
Learningcomputer.com. Using this Tab, you can import data from external sources including but not limited to: Text files Microsoft Access databases Web.
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
The State of SharePoint BI
KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
1 Computing for Todays Lecture 22 Yumei Huo Fall 2006.
Database Updates Made Easy In WebFocus Using SQL And HTML Painter Sept 2011 Lender Processing Services 1.
Importing Data Text Data Parsing Scrubbing Data June 21, 2012.
ACOT Intro/Copyright Succeeding in Business with Microsoft Excel
Analysing Data with Excel Importing Data from a Text File To import data from a text file: 1.Start Excel. 2.Click File, click New, click Workbook,
Miscellaneous Excel Combining Excel and Access. – Importing, exporting and linking Parsing and manipulating data. 1.
…and how to do stuff with them Copyright © The University of Southampton 2011 This work is licensed under the Creative Commons Attribution License See.
Damian Tamayo Tutorial DTM Data Generator Fall 2008 CIS 764.
Microsoft ® Office Excel 2003 Training Using XML in Excel SynAppSys Educational Services presents:
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Highline Class, BI 348 Basic Business Analytics using Excel Import, Clean, Transform, Data 1.
Advanced Tips And Tricks For Power Query
1 Data Manipulation (with SQL) HRP223 – 2009 October 12, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Eugene Meidinger Execution Plans
The power of Power Pivot Cristian Nicola DynamicsBIGuide.com.
OM. Platinum Level Sponsors Gold Level Sponsors Pre Conference Sponsor Venue Sponsor Key Note Sponsor.
Microsoft Power Query: an Excel Users Dream for Data Extraction and Cleansing Presented by: Belinda Allen Smith & Allen Consulting, Inc.
MAKING BUSINESS INTELLIGENT Brought to you by your local PASS Community! Self Service ETL with Power Query Welcome.
Microsoft Power Query 101 Belinda Allen Smith & Allen Consulting, Inc.
Develop Business Intelligence Application with Microsoft SharePoint 2013 Author: Vo Duy Anh.
Eugene Meidinger Power BI: Start to
Power BI: Getting Started and Keeping Up
John Tran Business Program Manager, The Suddath Companies
Pittsburgh Power BI Group
Just Enough Database Theory for Power Pivot / Power BI
SQL Server Analysis Services Fundamentals
Power BI Internals Eugene
Data Virtualization Demoette… Packaged Query Single Select Option
An (Advanced) Introduction to DAX
Miscellaneous Excel Combining Excel and Access.
What’s new in SQL Server 2017 for BI?
Power BI Performance Tips & Tricks
<Enter course name here>
Power Query Tips & Tricks
Solving the Hard Problems
mysql and mysql workbench
Exam Braindumps
Power BI Performance …Tips and Techniques.
Introduction to tabular models
Introduction to tabular models
Data Integration with Power Query
The Key to the Database Engine
SQL Server Analysis Services Fundamentals
BRK2279 Real-World Data Movement and Orchestration Patterns using Azure Data Factory Jason Horner, Attunix Cathrine Wilhelmsen, Inmeta -
Jose Almeida, BI Consultant
Power Query Discovery and connectivity to a wide range of data sources
Orchestration and data movement with Azure Data Factory v2
What query folding means to self-service BI projects
Data Modeling and Prototyping
Power BI Part 1: A Business User’s Perspective
Power BI – Exploring New Frontiers
Power BI Part 2: Internals
How To Make Accessible Word Documents
Power Query Tips & Tricks
Tutorial 7 – Integrating Access With the Web and With Other Programs
Welcome to SQLSaturday #767! Hosted by Lincoln SQL Server User Group
Execution plans Eugene
Donald Donais Minnesota SharePoint Users Group – April 2019
Introduction to Dataflows in Power BI
Power BI: Start to Finish
Dashboard in an Hour Using Power BI
Playing with (M)agic: Introduction to Writing M Code in Power BI
Nathalia Garay Gabriel Gonzalez Housing & Residential Life
Implementing ETL solution for Incremental Data Load in Microsoft SQL Server Ganesh Lohani SR. Data Analyst Lockheed Martin
Data Modeling and Prototyping
Presentation transcript:

Introduction to power query A.K.A The M Language

About me BI Consultant Pluralsight Author Pittsburgh PUG Co-Leader Went from SQL Newbie to SQL Pro in the last 7 years. Experience with T-SQL, SSRS, and Power BI. Pluralsight Author Author of video training on Pluralsight. Currently focusing on Power BI content. Pittsburgh PUG Co-Leader Help lead the Pittsburgh Power BI User Group. /eugenemeidinger @sqlgene eugene@sqlgene.com

What is Power Query? When should I use it? How does it work? Agenda We will cover the basics of Power Query and some language design What is Power Query? When should I use it? How does it work? Language Design Demos, Demos, Demos

What is power query? Power Query is a macro language for manual data manipulations Power Query allows for taking a manual cleanup process and turning it into an automated, repeatable process Power Query is a high level, declarative, dynamic, functional language Similar to F# More on this later Follows the 80/20 rule of user interaction 80% of your needs can be done from the GUI

What does it look like?

When should I use it? M stands for Menial labor and Manual data prep. (Well, not really) If you could pay someone Minimum wage do to it in Excel, then the M language can automate it for you. Official litmus test: “Users who get value from the Excel formula bar”. Great for self-service data prep. Can combine disparate data sources (CSV, Excel, SQL, Web) If all your data lives in SQL, you probably don’t need it.

An analogy: cooking in the kitchen If DAX is the head chef, M is the sous chef A sous chef does the prep work. Cleaning food, cutting vegetables, zesting, etc. A head chef sets the direction. Setting the menu, combining ingredients, etc. M cleans the data (shaping the data, removing bad values, etc.) DAX models the data (defining measures, associating tables, etc.) There is some overlap between the two.

How does it work? Extract Transform Load M Engine It all comes down to ETL Extract Transform Load M Engine Extract – Load the data from different sources Transform – Manipulate the data (replace values, pivot, add columns, etc.) Load – Export the data M Engine – Makes many decisions for us

An analogy: a warehouse floor We’ve got four different roles to think about Ed Teresa Larry Melissa Ed – Forklift driver and unboxer. Gets the raw materials. Teresa – Assembly line worker. Does the bulk of the work. Larry – Loads the finished goods for shipment. Melissa – Manages the warehouse, determines the shape of the assembly. We trust her to reorganize things as efficiently as possible.

Example M query Intimidating, right? let Source = Sql.Database("LOCALHOST", "AdventureWorks2014"), Production_Product = Source{[Schema="Production",Item="Product"]}[Data], #"Filtered Rows" = Table.SelectRows(Production_Product, each ([Color] = "Black")), #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"ProductID", "Name", "ProductNumber", "Color"}) in #"Removed Other Columns" Intimidating, right?

Applying roles SQL Filter on Black Remove Columns Output let Source = Sql.Database("LOCALHOST", "AdventureWorks2014"), Production_Product = Source{[Schema="Production",Item="Product"]}[Data], #"Filtered Rows" = Table.SelectRows(Production_Product, each ([Color] = "Black")), #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"ProductID", "Name", "ProductNumber", "Color"}) in #"Removed Other Columns"

Data sources Files (CSV, Excel, JSON, XML, PDF) Power Query supports a HUGE number of data sources Files (CSV, Excel, JSON, XML, PDF) Databases (SQL Server, Postgres, MySQL, Oracle) Web (OData, HTML tables, JSON, XML) Services (SharePoint, Exchange, etc.)

Data sources – Two different approaches Power Query provides a lingua franca for your data SSIS approach 29 data types!!! Rigidly defined Power Query approach 9 data types, 4 data structures Checks occur at runtime, allows for nested data types Minimalistic approach

Data sources – continued The M language uses a minimal set of data types Data Types: Boolean Number Time, Date, DateTime, DateTimeZone, Duration Text Binary Data Structures: List Record Table Function

Types of transformations Data transformations are the bread and butter of Power Query Combining data (merge, append, join) Modifying columns (remove, split, create, rename, fill values down) Modifying rows (promote headers, remove rows, remove duplicates) String manipulation (uppercase, replace values, trim) Other (pivot, unpivot, parse JSON/XML)

Where can it load into? Excel add-in (Get and Transform) Anywhere DAX is used, M is not far behind Excel add-in (Get and Transform) Power BI (Query Editor) SSAS 2017 (Data Sources) Microsoft Flow (new!) SSIS (In Preview)

Language features Declarative language Limited side-effects M has a number of features that make it interesting as a language Declarative language Limited side-effects Lazy evaluation Query Folding

Why does it matter? Declarative means we tell it what not how The M engine can make a significant number of optimizations Declarative means we tell it what not how Limited side-effects means reordering of steps is safe Lazy evaluation means we only run what we need Query Folding means offloading work to the database engine These all allow for better performance

Query folding SQL Filter on Black Remove Columns ??? ??? Output Query folding is when we push work back to the database engine. Teresa says to Ed, “Why don’t you just bring back the stuff that we need?” Ed replies, “That would be more efficient, huh?” Ed start only bringing the black parts they need. With nothing to do, Teresa now plays Minecraft 8 hours a day.

Query folding I tried to put this image into the laptop slide; the aspect ratio cut off the top and bottom of it, so I left it like this.

Power Query Demo

Learn more from Eugene Meidinger Thank You Learn more from Eugene Meidinger /eugenemeidinger @sqlgene eugene@sqlgene.com