Edit SAP variables in Power BI

Report authors who use SAP Business Warehouse (BW) or SAP HANA with DirectQuery can allow end users to edit SAP variables in Power BI Premium and shared workspaces. This article describes the requirements for editing SAP variables, how to enable this feature, and how to edit variables in Power BI Desktop and the Power BI service.

Requirements and limitations

The following lists describe the requirements and limitations for editing SAP variables:

Requirements

Limitations

  • Multidimensional models only for SAP HANA. For SAP HANA, the edit SAP variables feature works only with multidimensional models and doesn't work on relational sources. Ensure you have not selected Treat SAP HANA as a relational source in Options > Global > DirectQuery > DirectQuery options when editing SAP HANA variables in Power BI.

  • No sovereign cloud support. Power Query Online isn't available in sovereign clouds, so sovereign clouds don't support the edit SAP variables feature.

  • No mobile support. You can't edit SAP variables in Power BI mobile apps.

  • Workspace restrictions. Editing SAP variables doesn't work for reports in the Shared with me tab of My Workspace, or in apps created from V1 workspaces.

Enable editing SAP variables

To enable report users to edit SAP variables:

  1. In Power BI Desktop, connect to an SAP HANA or SAP BW data source with a DirectQuery connection.

  2. Go to File > Options and settings > Options, and in the left pane, select DirectQuery under Current File.

  3. Under DirectQuery options in the right pane, select the checkbox next to Allow end users to change SAP variables for this report.

    Screenshot that shows selecting the edit SAP variables option.

Edit SAP variables

In Power BI Desktop, you can edit variables by selecting Transform data > Edit variables in the ribbon. Report creators can add and select variables for the report by using the following dialog:

Screenshot that shows the Add items dialog.

After you publish a report that enables editing SAP variables, the Edit variables link appears in the Filter pane for the report in the Power BI service. The first time you publish the report, it might take up to five minutes before the Edit variables link appears.

Note

If the link doesn't appear, manually refresh the semantic model by selecting it from the list in the Semantic models tab of the workspace, and then selecting the Refresh icon.

To edit the variables in the Power BI service, report users can:

  1. Select Edit variables in the Filter pane for the report.

    Screenshot that shows the Edit variables link in the Filter pane.

  2. In the Edit variables dialog, edit and override the variable values, or select the Reset button to revert their changes.

    Screenshot that shows the Edit variables dialog in the Power BI service.

Similar to other Power BI persistence behaviors, any changes users make in the Edit variables dialog persist only for that user. Selecting Reset to default in the top menu bar resets the report to its original state, including the variables.

Screenshot that shows Reset to default.

You can change the default variables for reports you own in the Power BI service. If you own a report that uses SAP HANA or SAP BW and enables editing variables, select Edit variables to change the variables. When you save the report, the changed variables become the new default settings for that report. Other users who access the report after you make the changes see the new settings as the defaults.

Troubleshooting

If you get errors that Power BI can't load data or retrieve data for a visual, or that the data source connection failed, try the following actions to resolve the error:

  • In the Power BI service, select Edit variables, set default values for the variables, and then save the report.

  • In Power BI Desktop, if you no longer want users to be able to edit variables, uncheck the option at the report level.