Module.Versions

Updated on

Module.Versions is a Power Query M function that returns a record of module versions for the current module and its dependencies.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Module.Versions() as record

Description

The Module.Versions function in Power Query provides a straightforward way to determine the version of your Power Query instance. This function requires no arguments and produces a record. The record contains a field labeled Core, which holds the version number of your module.

Examples

Let’s look at some examples of the Module.Version function.

Retrieving the Power Query Version

Suppose you are using Power Query in Excel and you want to check its version. By calling the Module.Versions() function, you can easily retrieve this information. The function outputs a record indicating the version of the core module, which in this case might be 2.129.7294.1.

Here’s how you might call this function:

Module.Versions() // Output: [ Core = "2.129.7294.1" ]

As the result shows, the output is a record with a field called Core.

Including Version Information in Reports

You can use the version data to annotate reports or data transformations in Power Query, indicating the specific version that was used to generate the results. This is helpful for documentation or audit purposes, ensuring that the recipients can see the exact version of Power Query used.

Here’s how to append the Power Query version to a text output in your report:

// Output: "Produced with Power Query version: 2.129.7294.1"
"Produced with Power Query version: " & Module.Versions()[Core]

In this code, we extract the version number by applying field selection to the record. This extracts the value from the Core field allowing you to dynamically insert the version number into your query output.

Contribute » | Contributors: Rick de Groot