The Transformative Magic of Power Query M Code in Excel and Power BI


August 2024

The Transformative Magic of Power Query M Code in Excel and Power BI

A beginner’s guide to mastering the art of data metamorphosis to get just the data structure needed to create insightful data analysis solution

Add to Cart: $29.95 »

category: Excel, Power BI, Power Query
covers: Microsoft 365

Product Details
  • 209 pages
  • Publisher: Holy Macro! Books
  • ISBN: 978-1-61547-083-9
  • PDF ISBN: 978-1-61547-169-0

Using the Power Query Editor is similar to using the VBA Macro Recorder. It writes inefficient code and you don’t have the full power of the programming language. This book will teach you how to write Power Query from scratch. Unlock powerful features such as looping and more.

This book is about Power Query and M Code. Power Query and the functional language M Code (M) are the heart and soul of Microsoft’ s power data analysis tools: Excel, Power BI Desktop and Dataflows. The beautiful data driven and insightful PivotTables, Power BI solutions and Dashboards that you create usually require that you use Power Query and M Code to get, transform and load the data before you create the final reports and visuals. For many data analysis jobs, using the SQL language to perform ETL (extract, transform and load) is the preferred tool. Maybe even R or Python. But if you use Power BI or Excel, you better also be masterful with M Code and Power Query. Together, they give you the power to connect to multiple data sources, structuring your data with ease, and load to the worksheet, the data model in Excel or Power BI or Dataflow’ s Data Hub. As an accountant, professor, data analyst, author, Excel MVP and YouTuber for about 20 years, my specialty is in telling stories with videos and books to make complicated things less complicated and to inspire you to have fun with the power you can gain over data.

  • Introduction
  • Who This Book Is For
  • The Microsoft Power Query M Language Specification
  • Files to Download So You Can Follow Along
  • Chapter 1: Power Query and M Code

    • History of Power Query
    • Power Query and M Code
    • Comparing the Four Function-Based Languages
    • The User Interface and M Code
    • Three Locations to Edit M Code
    • The let Expression, Keywords, Identifiers, and Expressions
    • Three Different Load Data Buttons
    • Summary
  • Chapter 2: M Code Values

    • Type Values and Data Types
    • The if Expression
    • The Table.AddColumn Function
    • Date, Time, Datetime, Datetimezone, and Duration
    • Working with Date- and Time-Related Values
    • Using let Expressions to Define Variables in Formulas
    • Calculating Hours Elapsed from Datetime Values
    • Tables, Records, and Lists
    • Binary Values
    • Summary
  • Chapter 3: Custom Functions

    • Creating Two Reusable Function Queries
    • Creating a Custom Function in a Function Argument
    • Using each and an Underscore to Create a Custom Function
    • Creating a Custom Function Query Step in a let Expression
    • Recursion with Custom Functions
    • Using List.Accumulate to Simulate Recursion
    • Summary
  • Chapter 4: M Code Lookup Formulas

    • Exact Match Lookups
    • Approximate Match Lookups
    • Summary
  • Chapter 5: Unpivot, Append, Join, and Group By

    • Unpivot and the Table
    • Appending: Table.Combine vs. Table.ExpandTableColumn
    • Join Operations Used by the Merge Feature
    • The Table.Group Function and the Group By Feature
    • Other List Functions and Table.Sort, Too
    • Three Table.Group Tricks
    • Summary
  • Chapter 6: Data Connectors

    • CSV Files vs. Text Files
    • On-Premises File and Folder Paths
    • Using the Locale Feature to Import Data from Different Locales
    • ISO Dates
    • Online Data Sources
    • Summary
  • Chapter 7: Data Modeling

    • Project 1: Using From Folder and Combine Files to Combine Multiple Excel Files, Each with a Single Object
    • Project 2: Using a Custom Column to Combine Multiple Excel Files, Each with a Single Object
    • Project 3: Appending Multiple Text Files with Table Structure Problems
    • Project 4: Appending Tables with Inconsistent Column Names
    • Project 5: Appending JSON Tables with Filename Attributes
    • Project 6: Importing Multiple Excel Files, Each with Multiple Objects
    • Project 7: Combining Two Fact Tables into One Fact Table
    • Project 8: Converting a Single Column of Badly Structured Records into a Proper Table
    • Bonus Topic: Privacy Levels and Data Security
    • Bonus Example: Dynamically Connecting to SharePoint Server Files from Within an Excel File
    • Conclusion

Where to Buy

MrExcel Bookstore

Print book from MrExcel (USA Only)
PDF of the book available for download today
Total: $44.85
Special Deal for the first 200 customers: $29.95

MrExcel Bookstore

PDF from MrExcel

Amazon

Print Book from Amazon


Related Products


Microsoft 365 Excel: The Only App That Matters

June 2022

Excel Worksheet, Power Query, Power Pivot, Power BI. Calculations, Analytics, Modeling, Data Analysis and Dashboard Reporting for the New Era of Dynamic Data Driven Decision Making & Insight!


Cleaning Excel Data With Power Query Straight To The Point

March 2019

This book provides a quick Straight-to-the-Point introduction to Power Query. There’s a lot here, and there’s also a lot that’s not here. Reading this book will be like sitting down at a café and striking up a conversation with the person at the next table, where you learn enough random stuff about that person to decide if you want to know more and keep in touch.


Master Your Data with Power Query in Excel and Power BI

August 2021

Despite the moniker "data monkey," we information workers are often more like data magicians. Our data seldom enters our world in a ready-to-consume format; it can take hours of cleaning, filtering, and reshaping to get things ready to go. Power Query will make this process faster the first time and reduce it to a single button click every subsequent time.