Book Image

Learn Power Query

By : Linda Foulkes, Warren Sparrow
Book Image

Learn Power Query

By: Linda Foulkes, Warren Sparrow

Overview of this book

<p>Power Query is a data connection technology that allows you to connect, combine, and refine data from multiple sources to meet your business analysis requirements. With this Power Query book, you’ll be empowered to work with a variety of data sources to create interactive reports and dashboards using Excel and Power BI. </p><p>You’ll start by learning how to access Power Query across different versions of Excel and install the Power BI engine. After you've explored Power Pivot, you’ll see why Excel users find it challenging to clean data in Power Pivot and learn how Power Query can help to tackle the problem. The book will show you how to transform data using the Query Editor and write functions in Power Query. A dedicated section will focus on functions such as IF, Index, and Modulo, and creating parameters to alter query paths in a table. You’ll also work with dashboards, get to grips with multi-dimensional reporting, and create automated reports. As you advance, you'll cover the M formula language in Power Query, delve into the basic M syntax, and write the M query language with the help of examples such as loading all library functions offline in Excel and Power BI. Finally, the book will demonstrate the difference between M and DAX and show how results are produced in M. </p><p>By the end of this book, you’ll be ready to create impressive dashboards and multi-dimensional reports in Power Query and turn data into valuable insights.</p>
Table of Contents (17 chapters)
Free Chapter
1
Section 1: Overview of Power Pivot and Power Query
6
Section 2: Power Query Data Transformations
11
Section 3: Learning M

Using #shared to return library functions

In this section, we will look at the #shared libraries, which loads functions and enumerators in a result set. This means that we do not need any datasets as the code that we create will automatically make use of the #shared libraries. We will concentrate on creating text data types, numeric data types, lists, records, tables, searches, and shares, as well as importing a CSV file. With each of the different types, we will write the code so that we can see how it works and be able to apply it to other programs. We need to associate data with data types so that M knows whether the data is text, a number, or a string, and so on. We will briefly look at each of the most common data types and see the similarities and differences between them.

Text data types

We already created one example of this at the beginning of this chapter, Hello world. You will notice that it was not necessary for us to explicitly assign data types as the variable object...