Table.Skip

D

T

The M Code Behind the Power Query M function Table.Skip

What is Power Query M?

Power Query M is a functional, case-sensitive language used to query and transform data in Power Query. It is based on Microsoft’s Functional Language (MFL) and is used to write the M code that is executed in Power Query. The M code is used to build queries that extract, transform, and load data from various sources. Power Query M includes a wide range of functions, including Table.Skip, which we’ll be discussing in this article.

What is the Table.Skip function?

The Table.Skip function is a Power Query M function that allows users to skip a specified number of rows in a table. This function is useful when working with large datasets and you only want to focus on a portion of the data. By using the Table.Skip function, you can easily skip a certain number of rows in a table and focus on the data that is relevant to your analysis.

The M Code Behind the Table.Skip Function

The M code behind the Table.Skip function is relatively simple. To use the Table.Skip function, you need to specify the number of rows that you want to skip. The syntax for the Table.Skip function is as follows:


Table.Skip(table as table, count as number) as table


In this syntax, the “table” parameter is the input table that you want to skip rows from, and the “count” parameter is the number of rows that you want to skip. The output of the Table.Skip function is a new table that contains the remaining rows after skipping the specified number of rows.

Here’s an example of the M code behind the Table.Skip function:


let

Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8ixLLdJRMgZwNlKSIrJBYEgWlJAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column 1" = _t]),

#"Skipped Rows" = Table.Skip(Source, 3)

in

#"Skipped Rows"


In this example, we’re using the Table.FromRows function to create a table from a JSON document. We then use the Table.Skip function to skip the first 3 rows of the table. The output is a new table that contains all the rows after the third row.

The Table.Skip function is a powerful tool in Power Query that allows users to skip a specified number of rows in a table. By using the M code behind the Table.Skip function, users can easily extract, transform, and load data from various sources. Whether you’re working with large datasets or just need to focus on a portion of the data, the Table.Skip function can help streamline your data analysis processes.

Power Query and M Training Courses by G Com Solutions (0800 998 9248)

Upcoming Courses

Contact Us

    Subject

    Your Name (required)

    Company/Organisation

    Email (required)

    Telephone

    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)