Skip to content

Connect Xtract Universal to Power BI Desktop (M-Script)

This article shows how to use an M-script to connect Xtract Universal with Power BI Desktop. For information on how to connect using the Xtract Universal Custom Connector, refer to Connect Xtract Universal to Power BI Desktop (Custom Connector).

Connect Power BI Desktop with Xtract Universal

To set up the Power Query M-script in Power BI Desktop to connect with Xtract Universal:

  1. Create a new Power BI report using Home > Get Data > Blank Query as a data source.
  2. Open the [Advanced Editor].
    Advanced Editor
  3. Copy the content of the loading_script.txt file into the editor.
  4. Change the values for ExtractionName and ServerURL to match the name of your Xtract Universal extraction name and server URL .
    PowerQueryEditor
  5. Click [Done] to confirm the script .
  6. If prompted, provide an authentication method for the Power BI and Xtract Universal connection. For more information, see Single Sign On and SAP Authentication.
  7. Close the Power Query Editor and apply changes when prompted.
  8. Save the Report.

Your SAP data is now available for further processing.

Power BI Settings

To use the Xtract Universal data source efficiently, adjust the following settings in Power BI Desktop:

  1. Navigate to File > Options and settings > Options.
  2. Open the Security tab and activate the option (Not Recommended) Allow any extension to load without validation or warning.
    Power BI cache
  3. Optional: Increase the Power BI cache in the tab Load Data to prevent multiple calls from Power BI to Xtract Universal when extracting large data volumes. Multiple calls result in in multiple entries for the same extraction in the Xtract Universal extraction log.
    Power BI cache

Parameters

You can pass parameters to Xtract Universal using the Parameters entry inside the M-script:

let
    ExtractionName = "mara",
    ServerUrl = "http://localhost:8065",

    // Record containing run parameters with corresponding values, can be empty
    // Usage: <XU parameter name>= <value or Power BI parameter>
    // MUST NOT use "name" as a record field here
    Parameters = [ /*rows= "300", myparameter= SomePowerBIParameter*/ ],

For a complete list of possible parameters, see extraction parameters.

Pass Static Values

The example below passes a static value (300) to the Xtract Universal parameter row:

Parameters = [ rows= "300"],

Pass Power BI Parameters

Using Power BI parameters allows changing values without editing the query logic. To create parameters in Power BI Desktop, go to Home > Manage Parameters > New Parameter:
power-bi-manage-parameters-menu

The example below passes a Power BI parameter (p_myParameter) to the Xtract Universal parameter row:

Parameters = [ rows= p_myParameter ],

Map Custom Runtime Parameters

Xtract Universal allows creating custom runtime parameter inside extractions that can be used to create custom data filters. You can find a list of all custom runtime parameters of an extraction in the Custom tab of the "Run Extraction" menu:
XU_PBI_XU_Parameters_1

The example below maps a Power BI parameter (p_myParameter) to an Xtract Universal custom runtime parameter (MyParameter).

Parameters = [ myParameters= p_myParameter],


Last update: January 16, 2026