Reader small image

You're reading from  The Definitive Guide to Power Query (M)

Product typeBook
Published inMar 2024
Reading LevelBeginner
PublisherPackt
ISBN-139781835089729
Edition1st Edition
Languages
Right arrow
Authors (3):
Gregory Deckler
Gregory Deckler
author image
Gregory Deckler

Greg Deckler is a 7-time Microsoft MVP for Data Platform and an active blogger and Power BI community member, having written over 6,000 solutions to community questions. Greg has authored many books on Power BI, including Learn Power BI 1st and 2nd Editions, DAX Cookbook, Power BI Cookbook 2nd Edition and Mastering Power BI 2nd Edition. Greg has also created several external tools for Power BI and regularly posts video content to his YouTube channels, Microsoft Hates Greg and DAX For Humans.
Read more about Gregory Deckler

Rick de Groot
Rick de Groot
author image
Rick de Groot

Rick de Groot was born in the Netherlands and has been working in BI for more than 14 years. He went freelance in 2016 and now works as an independent Power BI consultant. On his mission to make Power BI more accessible, he started two blogs: BI Gorilla and PowerQuery. how, and a YouTube channel sharing Power Query and Power BI content. His commitment to offering free content through multiple platforms has led him to earning the Microsoft Data Platform MVP award for two consecutive years.
Read more about Rick de Groot

Melissa de Korte
Melissa de Korte
author image
Melissa de Korte

Melissa de Korte's approach to facing challenges is fueled by relentless curiosity. She is a dedicated community member and content creator. Her portfolio includes blogs, tutorials, courses, and webinars, that make Power Query M more accessible and useful for all. Behind her professional persona lies a genuine dedication to empowering others through education and knowledge sharing, and a desire to encourage professionals to embrace the potential of Power Query, M.
Read more about Melissa de Korte

View More author details
Right arrow

Troublesome Data Patterns

Reshaping and preparing data for analysis is often a combination of art and science, blending theory and skills with creative problem-solving. There are a wide range of troublesome data patterns, from dealing with stacked data to multiline headers and beyond. Challenges are not limited to the structure of the data alone but often also include inconsistencies and other complexities that can arise from the unique nature of the data itself or specific business rules and requirements.

When we think about problem-solving, it’s important to remember that there are many different approaches and techniques. In this book, we’re not claiming to have all the answers or that these methods are best. Rather, we aim to offer a collection of ideas and spark your imagination to help you kick-start your problem-solving journey, making you confident in facing any troublesome data pattern that crosses your path.

The examples provided throughout this chapter...

Pattern matching

Pattern matching is an essential skill often associated with regular expressions (or regex), which is important for identifying and manipulating specific patterns in textual data. Although the Power Query M language lacks direct support for regex, it provides a wealth of functions that can help address these types of requirements. In this section, we explore pattern matching within the constraints of Power Query, highlighting some key techniques and strategies for addressing these challenges.

Basics of pattern matching

Pattern matching is incredibly useful for finding and extracting specific character sequences from data. That process relies heavily on the use of text functions. The M language is equipped with various functions that operate on text values. These functions can facilitate certain aspects relevant to pattern matching. They offer a range of capabilities, from basic to more advanced string operations.

Here, we’ll delve into various considerations...

Combining data

Although the process of extracting and combining data may seem straightforward at a glance, it can quickly turn into a complex and demanding task. The level of complexity largely depends on the characteristics of the data and its organization. From the perspective of this section, it’s important to understand that by combining data we mean an append operation, typically seen when consolidating files.

In the real world, data often originates from various sources and is managed by multiple users, which complicates maintaining consistency across all files. Excel workbooks, in particular, is a very common format, as Excel is used extensively across many industries for numerous data-related tasks.

In this section, we’ll delve into techniques and strategies to overcome challenges commonly faced when working with multiple Excel files. While some are specific to the nature of Excel, others are more generic and applicable across different scenarios.

...

Summary

In this chapter, we have highlighted practical aspects of data manipulation and preparation by focusing on two very different topics: extracting fixed patterns and combining data from multiple Excel files. Although they feel worlds apart, these skills, among many others, are both essential for transforming raw data into insightful, actionable information.

By breaking down processes into manageable pieces, underscoring the importance of a methodical approach as well as creative problem-solving, we aimed to offer a collection of ideas, fuelling your imagination to tackle any challenge. The next chapter focuses on another critical area: optimizing performance. You will learn about factors that influence, and methods to improve, query performance.

Learn more on Discord

Join our community’s Discord space for discussions with the author and other readers:

https://discord.gg/vCSG5GBbyS

lock icon
The rest of the chapter is locked
You have been reading a chapter from
The Definitive Guide to Power Query (M)
Published in: Mar 2024Publisher: PacktISBN-13: 9781835089729
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (3)

author image
Gregory Deckler

Greg Deckler is a 7-time Microsoft MVP for Data Platform and an active blogger and Power BI community member, having written over 6,000 solutions to community questions. Greg has authored many books on Power BI, including Learn Power BI 1st and 2nd Editions, DAX Cookbook, Power BI Cookbook 2nd Edition and Mastering Power BI 2nd Edition. Greg has also created several external tools for Power BI and regularly posts video content to his YouTube channels, Microsoft Hates Greg and DAX For Humans.
Read more about Gregory Deckler

author image
Rick de Groot

Rick de Groot was born in the Netherlands and has been working in BI for more than 14 years. He went freelance in 2016 and now works as an independent Power BI consultant. On his mission to make Power BI more accessible, he started two blogs: BI Gorilla and PowerQuery. how, and a YouTube channel sharing Power Query and Power BI content. His commitment to offering free content through multiple platforms has led him to earning the Microsoft Data Platform MVP award for two consecutive years.
Read more about Rick de Groot

author image
Melissa de Korte

Melissa de Korte's approach to facing challenges is fueled by relentless curiosity. She is a dedicated community member and content creator. Her portfolio includes blogs, tutorials, courses, and webinars, that make Power Query M more accessible and useful for all. Behind her professional persona lies a genuine dedication to empowering others through education and knowledge sharing, and a desire to encourage professionals to embrace the potential of Power Query, M.
Read more about Melissa de Korte