Metrica
Metrica
✕
  • Home
  • Products
    • Power BI Connector for Salesforce
    • Power BI Connector for SAP
  • Resources
    • Blog
    • Trust Center
Explore Products

Home - Metrica Documentation: Power BI Connectors - How to Import Salesforce Data into Microsoft Power BI

Getting Started

  • Installation Guide
  • Explore Power BI Connector for Salesforce

Admin Guide

  • Application Permissions Setup
  • Access Token Management

User Guide

  • How to Set Up Incremental Refresh in Power BI
  • How to Import Salesforce Data into Microsoft Power BI
  • How to Create Data Source
  • How to Share Data Source
  • How to View Entity Relationship Diagram
  • How to Optimize Data Export Time
  • How to View Data Sources History
  • How to View Export History

FAQ & Troubleshooting

  • What data can I export from Salesforce?
  • Why is my data export slow or taking a long time to refresh?
  • What does “Data Source” mean? How many data sources can I create?
  • Why can’t I see some fields or custom objects in my data export?

Support

  • Contact Support
  • Pricing and Licensing
View Categories
  • Home
  • Metrica Documentation: Power BI Connectors
  • Power BI Connector for Salesforce Documentation
  • User Guide
  • How to Import Salesforce Data into Microsoft Power BI

How to Import Salesforce Data into Microsoft Power BI

4 min read

This guide walks you through connecting Power BI to your data source using the Power BI Connector application. Follow the steps below carefully to complete the setup.

1. Create an Access Token #

Before connecting Power BI, you need to generate an access token.

Step 1: Open the Connector App #

  • Open the Power BI Connector application.
  • Go to the Access Tokens menu.

Step 2: Create a New Token #

  • Click the Create Token button.
  • Enter any label (name) for your token.
  • (Recommended) Set an expiry date.
  • Click Create.
⚠ Important:
You can view and copy the token only once. Make sure you copy it immediately and store it securely.
Do not share this token with anyone.

You can revoke any token at any time from the Access Tokens menu. Expired tokens automatically stop working, so it is safe to revoke them when needed.

2. Create a Data Source in Power BI Connector #

Before moving to Power BI Desktop, you need to create a Data Source inside the Power BI Connector application.

This is where you define:

  • The report name
  • Which Salesforce objects (tables) to export
  • Which fields to include

Step 1: Open Data Sources #

  • Open the Power BI Connector application.
  • Go to the Data Sources section.
  • Click Create data source.

Step 2: Enter General Information #

On the Create Data Source screen:

  • Enter a Name for your report
    (Example: Contacts Report)
  • Optionally add a Description

Step 3: Select Objects and Fields #

  1. Find the Salesforce object you want to export (e.g., Account, Contact, Case).
  2. Check the object.
  3. Expand it to see available fields.
  4. Select the fields you want included in your export.

You can:

  • Use the search bar to find specific fields
  • Switch between Basic and SOQL modes if needed

Repeat this for all objects and fields you want included in the report.

Step 4: Save the Data Source #

  • Click Save (top right corner).
  • After saving, return to the Data Sources list.

Step 5: Copy the Power Query Script #

In the Data Sources list:

  • Find your newly created data source.
  • Click the copy icon (Power Query icon) next to it.
  • This copies the Power Query script to your clipboard.

The copied script will look similar to this:

let
    Source = OData.Feed(
        "[your Site URL]/services/apexrest/metrica_powerbi/OAuthProxy/a00XXXXXXXXXXXX",
        [xUserKey=metricaToken]
    ),
    Renamed = Table.RenameColumns(Source, {{"Data", "Value"}}),
    Selected = Table.SelectColumns(Renamed, {"Name", "Value"}),
    AsRecord = Record.FromTable(Selected)
in
    AsRecord

Where:

  • [your Site URL] is the Salesforce Site URL you created earlier
    (Example: https://your-instance.my.salesforce-sites.com)
  • metricaToken is the parameter you will create in Power BI Desktop
  • The last part (a00XXXXXXXXXXXX) is your specific Data Source ID and will be different for each report

You will paste this script into Power BI Desktop in the next section.

3. Prepare Power BI (Desktop) #

Step 1: Create a Blank Report #

  • Open Power BI Desktop.
  • Create a new Blank Report.
  • Go to Get Data → Blank Query.

Step 2: Create a Token Parameter #

Now you’ll store your access token inside Power BI.

  • Click Manage Parameters → New Parameter
  • Set:
    • Name: metricaToken
    • Current Value: Paste your active access token
  • Click OK

4. Set Up Authorization & Choose Data Source #

Step 1: Copy the Data Source Script #

  • Open Salesforce.
  • Open the Power BI Connector application.
  • Find the data source you want to download.
  • Click the Copy button next to it.

Step 2: Paste the Script into Power BI #

  • Go back to Power BI.
  • In the Queries panel, right-click on Query1.
  • Click Advanced Editor.
  • Remove any existing script.
  • Paste the script you copied.
  • Click Done.

Step 3: Edit Credentials (If Required) #

If you see an Edit Credentials button:

  • Click Edit Credentials
  • Select Anonymous
  • Click Connect
i
If you do not see the “Edit Credentials” button, Power BI already knows what to do — you can skip this step.

5. Prepare Tables for Your Report #

Now you’ll add the tables (Salesforce objects) you want to use.

Step 1: Add a Table as a New Query #

  • Find the object you want to use.
  • Right-click on the word Table next to the object name.
  • Click Add as New Query.

Step 2: Rename the Table #

Make sure the new query has exactly the same name as the Salesforce object.

Step 3: Repeat for All Required Tables #

  • Return to Query1.
  • Repeat the previous steps for each table you want in your report.

Step 4: Clean Up Query1 #

Once all tables are added:

You can either:

  • Delete Query1 (for a cleaner report), or
  • Hide it (recommended if you may need it later)

Step 5: Apply Changes #

  • Go to the Home tab.
  • Click Close & Apply.
  • Wait for Power BI to download the data.

 After the data loads, you can hide Query1 if you haven’t already.

Setup Complete #

Your Power BI report is now connected and ready to use.

If you need to update your token in the future, simply edit the metricaToken parameter with a new active token.

Updated on March 18, 2026

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
How to Set Up Incremental Refresh in Power BIHow to Create Data Source
Table of Contents
  • 1. Create an Access Token
    • Step 1: Open the Connector App
    • Step 2: Create a New Token
  • 2. Create a Data Source in Power BI Connector
    • Step 1: Open Data Sources
    • Step 2: Enter General Information
    • Step 3: Select Objects and Fields
    • Step 4: Save the Data Source
    • Step 5: Copy the Power Query Script
  • 3. Prepare Power BI (Desktop)
    • Step 1: Create a Blank Report
    • Step 2: Create a Token Parameter
  • 4. Set Up Authorization & Choose Data Source
    • Step 1: Copy the Data Source Script
    • Step 2: Paste the Script into Power BI
    • Step 3: Edit Credentials (If Required)
  • 5. Prepare Tables for Your Report
    • Step 1: Add a Table as a New Query
    • Step 2: Rename the Table
    • Step 3: Repeat for All Required Tables
    • Step 4: Clean Up Query1
    • Step 5: Apply Changes
  • Setup Complete
Metrica
Explore Products
Products
  • Power BI Connector for Salesforce
  • Power BI Connector for SAP
Resources
  • Blog
  • Trust Center
  • Contact Sales

Metrica Software builds enterprise data connectors that provide analytics platforms with direct access to complex business systems such as SAP and Salesforce.

The focus is on predictable behavior, controlled access, and long-term operation in production environments.

© 2026. All rights reserved.

Privacy Policy

Terms of Use

    Contact Us







    Secure & private form

    1-2 min

    ×

      Contact Sales








      Secure & private form

      1-2 min

      ×