Reader small image

You're reading from  Data Cleaning with Power BI

Product typeBook
Published inFeb 2024
PublisherPackt
ISBN-139781805126409
Edition1st Edition
Right arrow
Author (1)
Gus Frazer
Gus Frazer
author image
Gus Frazer

Gus Frazer is a seasoned analytics consultant who focuses on business intelligence solutions. With over eight years of experience working for the two market-leading platforms, Power BI (Microsoft) and Tableau, he has amassed a wealth of knowledge and expertise. He also has experience in helping hundreds of customers to drive their digital and data transformations, scope data requirements, drive actionable insights, and most important of all, clean data ready for analysis.
Read more about Gus Frazer

Right arrow

Filtering and sorting data with M

Filtering and sorting are essential data transformation tasks that help you extract relevant information from large datasets and organize it in a meaningful way.

Power Query’s M language offers a range of functions to efficiently filter rows based on conditions and sort data according to specific criteria. In this section, we’ll explore how to filter and sort data using M, accompanied by step-by-step examples and explanations of key functions.

First of all, filtering data from your analysis typically involves selecting certain rows from a dataset based on certain conditions. M has a function named Table.SelectRows for this exact purpose. As it suggests, it allows you to specify a condition within the argument that determines which rows should be retained.

Following on from the Products table we connected our M to earlier, we can add an additional step to help us filter the data for analysis.

For example, suppose for our analysis...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Data Cleaning with Power BI
Published in: Feb 2024Publisher: PacktISBN-13: 9781805126409

Author (1)

author image
Gus Frazer

Gus Frazer is a seasoned analytics consultant who focuses on business intelligence solutions. With over eight years of experience working for the two market-leading platforms, Power BI (Microsoft) and Tableau, he has amassed a wealth of knowledge and expertise. He also has experience in helping hundreds of customers to drive their digital and data transformations, scope data requirements, drive actionable insights, and most important of all, clean data ready for analysis.
Read more about Gus Frazer