View Categories

How to Import SAP Data into Microsoft Power BI

This guide walks you through connecting Power BI Connector for SAP to Microsoft Power BI Desktop, from creating an access token to loading SAP entities into a report and refreshing it in the Power BI service.

You need three things from the connector before you open Power BI: an access token, a data source, and that data source’s OData URL. The sections below create them in that order, then use them in Power BI Desktop.

i
New to the connector? Explore Power BI Connector for SAP has a tour of the app and a four-step quickstart. This page is the long-form version of its last two steps.

1. Create an Access Token #

Power BI authenticates to your data source with HTTP Basic authentication: your connector user name plus a personal access token. The token carries the same data permissions you have in the connector, no more and no less, and can be revoked on its own without touching your account.

Step 1: Open Access Tokens #

  • Sign in to the connector. You land on the Data Sources page.
  • In the left navigation, select Access Tokens. The page lists every token you have created with its label, creation date, expiry and status.
Access Tokens page

Step 2: Create the token #

  • Select Create token.
  • Enter a Label that tells you where the token is used, for example Power BI Desktop — laptop. The label is for your own bookkeeping and never leaves the connector.
  • Confirm.
Create token dialog

Step 3: Copy the token #

The token value is shown exactly once, in a follow-up dialog with eye and copy buttons. Copy it now and keep it somewhere safe until you paste it into Power BI in section 4.

New token shown once
⚠ Important: The connector never displays the token again. If you close the dialog without copying it, revoke that token and create a new one. Treat the token like a password and do not share it.

You can have up to 5 active tokens per user; revoke unused ones from the Access Tokens page to free a slot. If your administrator has set a token expiry policy, the Expires on column shows when each token stops working.

i
Only a hashed reference of the token is kept in the connector’s own database; the value itself is held in the SAP Credential Store, encrypted at rest with SAP-managed, customer-isolated keys, and every token created or revoked is written to the audit trail on the History page. Nobody, including administrators and Metrica, can read a token back after the dialog closes.

2. Create a Data Source #

A data source bundles one or more SAP OData services, a selection of entities and fields, and optional row filters into a single OData endpoint that Power BI can read.

  • On Data Sources, select Create.
  • Enter a Name. Description and Shared with are optional and can be changed later.
  • Select Add Service, type at least two characters of the SAP service name, and pick the service. Repeat to add more services to the same data source.
  • Expand the service, then each entity, and tick the fields Power BI should see. Use Filter inside an entity to trim rows on the SAP side.
  • Select Save. You return to the Data Sources list.
Create data source form
Entity expanded with fields selected
i
Every option of the form (service catalog, field picker, Basic and OData filter editors, Preview and Preview ERD) is covered in Create a Data Source. Loading the metadata of a large SAP service can take up to a minute the first time; wait for the Loading service metadata indicator to disappear.

3. Copy the Data Source URL #

Each data source has its own OData URL. Power BI binds to this URL, not to the data source name, so you can rename the data source later without breaking a report.

  • In the Data Sources list, find your data source.
  • The URL column shows the endpoint. Select the copy icon next to it to copy the full URL.
URL column with the copy icon

The URL stays the same for the life of the data source. Only the rows behind it change as SAP data changes.

4. Connect Power BI Desktop #

Power BI Desktop reads the data source through its built-in OData feed connector. No script is needed.

Step 1: Add an OData feed #

  • Open Power BI Desktop and start a Blank report.
  • On the Home tab, open the Get data drop-down and select OData feed.
Power BI Desktop, Home tab, Get data drop-down open with OData feed highlighted
  • Paste the data source URL you copied in section 3 into the URL field. Leave the dialog in its Basic mode (a single URL field) and the other options at their defaults.
  • Select OK.
OData feed dialog with a data source URL pasted (URL masked)

Step 2: Enter your credentials #

The first time Power BI Desktop connects to this URL it asks how to authenticate.

  • In the left column, select Basic.
  • In User name, enter your connector user name: the account you sign in to the connector with, shown in the toolbar.
  • In Password, paste the access token from section 1.
  • Leave the level at the data source URL and select Connect.
OData feed credentials dialog, Basic selected, user name filled, password masked
i
Power BI Desktop remembers these credentials per URL. You will not be asked again for this data source on this computer until the token is revoked or expires, see Updating the token below.

Step 3: Pick the entities #

Power BI fetches the metadata and opens the Navigator with one entry per entity in the data source. Tick the entities you want in the report. The right-hand pane shows a preview of the selected one.

Navigator with the data source's entities listed and one ticked, preview on the right
  • Select Load to bring the entities into the model as they are.
  • Select Transform Data instead if you want to rename columns, change types or combine entities in the Power Query Editor first, then use Close & Apply.

The entities appear as tables in the Data pane, ready for visuals.

Report view after Load, the entities in the Data pane

To pull fresh data from SAP later, select Refresh on the Home tab. The first load of a large service can take up to a minute while SAP produces the metadata; later refreshes are faster.

5. Publish to the Power BI Service and Refresh Online #

A report published to the Power BI service can refresh on a schedule without anyone signing in. The service keeps its own copy of the credentials, so you enter the user name and token once more after publishing.

Step 1: Create a token for the service #

Create a separate token for the service so you can revoke it independently of the one your computer uses, and label it accordingly, for example Power BI service refresh. If your tenant enforces a token expiry, note the date: scheduled refresh fails the day the token expires.

Access Tokens list with a token labeled for the service

Step 2: Publish the report #

  • In Power BI Desktop, select Publish on the Home tab and choose a workspace.
  • In the Power BI service, open the workspace and find the semantic model that was published with the report. Open its menu (···) and select Settings.

Step 3: Enter the credentials in the service #

  • Expand Data source credentials and select Edit credentials on the OData entry.
  • Set Authentication method to Basic.
  • Enter your connector user name and paste the service token as the password.
  • Select Sign in. The service stores the credentials and reuses them for every refresh.
Power BI service, semantic model Settings > Data source credentials > Configure dialog, Basic

Step 4: Schedule the refresh #

On the same settings page, expand Refresh, switch on Scheduled refresh, and pick a frequency, time zone and one or more times. The service runs the first refresh at the next slot; Refresh now in the workspace list runs one immediately.

Power BI service, Refresh section with Scheduled refresh switched on
⚠ Desktop credentials do not travel with the report. A model that loads fine in Power BI Desktop returns 401 Unauthorized in the service until you enter the user name and token under Data source credentials.

6. Updating the Token #

When a token is revoked or expires, Power BI returns 401 Unauthorized on the next refresh, and the Power BI service emails the model owner after a few consecutive failures. Create a new token in the connector and put it where Power BI keeps the credentials:

  • Power BI Desktop: File → Options and settings → Data source settings, select the data source URL, Edit Permissions → Edit, paste the new token as the password and save. Then Refresh.
  • Power BI service: semantic model Settings → Data source credentials → Edit credentials, paste the new token and Sign in. Then refresh the model.

The data source URL never changes. Only the credentials do.

Troubleshooting #

What you seeWhat it meansWhat to do
401 UnauthorizedThe token was revoked or expired, the user name does not match the account that created the token, or Power BI cached an old token.Check the token status on Access Tokens. Create a fresh token and update the credentials (section 6).
403 Forbidden on a data source that worked beforeYour token is valid, but you no longer have access to this data source: the owner removed you from the sharing list or deleted it.Ask the owner. See See What’s Been Shared with You.
The first load runs for a minute or moreSAP is producing the metadata document for a large service; the first request is slow and later ones are cached.Wait it out. If it never finishes, check Export History in the connector for an error around that time.
The Navigator lists fewer entities than expectedThe data source only exposes the entities and fields selected when it was created.Edit the data source and add the missing entities, then refresh in Power BI.
Works in Desktop, 401 in the serviceThe service has no credentials yet; Desktop credentials are not published with the report.Enter the user name and token under Data source credentials (section 5).