EPC Group - Enterprise Microsoft AI, SharePoint, Power BI, and Azure Consulting
G2 High Performer Summer 2025, Momentum Leader Spring 2025, Leader Winter 2025, Leader Spring 2026
BlogContact
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌

EPC Group

Enterprise Microsoft consulting with 29 years serving Fortune 500 companies.

(888) 381-9725
contact@epcgroup.net
4900 Woodway Drive, Suite 830
Houston, TX 77056

Follow Us

Solutions

  • M&A Practices

    • M&A Tenant Migration
    • Carve-Out Migration
    • Private Equity Practice
    • Engagement Operating Model
  • All Services
  • Microsoft 365 Consulting
  • AI Governance
  • Azure AI Consulting
  • Cloud Migration
  • Microsoft Copilot
  • Data Governance
  • Microsoft Fabric
  • Dynamics 365
  • Power BI Consulting
  • SharePoint Consulting
  • Microsoft Teams
  • vCIO / vCAIO Services
  • Large-Scale Migrations
  • SharePoint Development

Industries

  • All Industries
  • Healthcare IT
  • Financial Services
  • Government
  • Education
  • Teams vs Slack

Power BI

  • Case Studies
  • 24/7 Emergency Support
  • Dashboard Guide
  • Gateway Setup
  • Premium Features
  • Lookup Functions
  • Power Pivot vs BI
  • Treemaps Guide
  • Dataverse
  • Power BI Consulting

Company

  • About Us
  • Our History
  • Microsoft Gold Partner
  • Case Studies
  • Testimonials
  • Fixed-Fee Accelerators
  • Blog
  • Resources
  • All Guides & Articles
  • Video Library
  • Client Reviews
  • Engagement Operating Model
  • FAQ
  • Contact
  • Schedule a consultation

Microsoft Teams

  • Teams Questions
  • Teams Healthcare
  • Task Management
  • PSTN Calling
  • Enable Dial Pad

Azure & SharePoint

  • Azure Databricks
  • Azure DevOps
  • Azure Synapse
  • SharePoint MySites
  • SharePoint ECM
  • SharePoint vs M-Files

Comparisons

  • M365 vs Google
  • Databricks vs Dataproc
  • Dynamics vs SAP
  • Intune vs SCCM
  • Power BI vs MicroStrategy

Legal

  • Sitemap
  • Privacy Policy
  • Terms
  • Cookies

About EPC Group

EPC Group is a Microsoft consulting firm founded in 1997 (originally Enterprise Project Consulting, renamed EPC Group in 2005). 29 years of enterprise Microsoft consulting experience. EPC Group historically held the distinction of being the oldest continuous Microsoft Gold Partner in North America from 2016 until the program's retirement. Because Microsoft officially deprecated the Gold/Silver tiering framework, EPC Group transitioned to the modern Microsoft Solutions Partner ecosystem and currently holds the core Microsoft Solutions Partner designations.

Headquartered at 4900 Woodway Drive, Suite 830, Houston, TX 77056. Public clients include NASA, FBI, Federal Reserve, Pentagon, United Airlines, PepsiCo, Nike, and Northrop Grumman. 6,500+ SharePoint implementations, 1,500+ Power BI deployments, 500+ Microsoft Fabric implementations, 70+ Fortune 500 organizations served, 11,000+ enterprise engagements, 200+ Microsoft Power BI and Microsoft 365 consultants on staff.

About Errin O'Connor

Errin O'Connor is the Founder, CEO, and Chief AI Architect of EPC Group. Microsoft MVP multiple years, first awarded 2003. 4× Microsoft Press bestselling author of Windows SharePoint Services 3.0 Inside Out (MS Press 2007), Microsoft SharePoint Foundation 2010 Inside Out (MS Press 2011), SharePoint 2013 Field Guide (Sams/Pearson 2014), and Microsoft Power BI Dashboards Step by Step (MS Press 2018).

Original SharePoint Beta Team member (Project Tahoe). Original Power BI Beta Team member (Project Crescent). FedRAMP framework contributor. Worked with U.S. CIO Vivek Kundra on the Obama administration's 25-Point Plan to reform federal IT, and with NASA CIO Chris Kemp as Lead Architect on the NASA Nebula Cloud project. Speaker at Microsoft Ignite, SharePoint Conference, KMWorld, and DATAVERSITY.

© 2026 EPC Group. All rights reserved. Microsoft, SharePoint, Power BI, Azure, Microsoft 365, Microsoft Copilot, Microsoft Fabric, and Microsoft Dynamics 365 are trademarks of the Microsoft group of companies.

The Power BI REST API lets you query dataset data programmatically using DAX queries sent over HTTPS. You authenticate via Azure AD (OAuth 2.0), call the Execute Queries endpoint, and receive JSON results. This guide covers authentication setup, the DAX query format, API limits, and Python/PowerShell examples.

Key Facts

  • The key endpoint: POST https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/executeQueries
  • Authentication: Azure AD OAuth 2.0 token. Scopes: https://analysis.windows.net/powerbi/api/.default
  • API limits: 100,000 rows per result, 120-second query timeout, one EVALUATE per request.
  • Requires a Power BI Pro or Premium Per User (PPU) license for the calling account.
  • Supports DAX queries only — not SQL. Your query goes inside an EVALUATE statement.
  • EPC Group: 29 years of Microsoft consulting, 1,500+ Power BI deployments, Microsoft Solutions Partner.
Back to Blog

How to Get Data from a Power BI Dataset via an API

Errin O\'Connor
December 2025
8 min read

How to Get Data from a Power BI Dataset via an API

The Power BI REST API lets you query dataset data programmatically using DAX queries sent over HTTPS. You authenticate via Azure AD (OAuth 2.0), call the Execute Queries endpoint, and receive JSON results. This guide covers authentication setup, the DAX query format, API limits, and Python/PowerShell examples.

Key facts

  • The key endpoint: POST https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/executeQueries
  • Authentication: Azure AD OAuth 2.0 token. Scopes: https://analysis.windows.net/powerbi/api/.default
  • API limits: 100,000 rows per result, 120-second query timeout, one EVALUATE per request.
  • Requires a Power BI Pro or Premium Per User (PPU) license for the calling account.
  • Supports DAX queries only — not SQL. Your query goes inside an EVALUATE statement.
  • EPC Group: 29 years of Microsoft consulting, 1,500+ Power BI deployments, Microsoft Solutions Partner.

Step 1 — Register an Azure AD app

Before calling the API, register an app in Azure AD to get client credentials.

  1. Open the Azure portal → Azure Active Directory → App registrations → New registration.
  2. Name the app (e.g., "PowerBI-API-Client") and set the redirect URI for your client type.
  3. Under API permissions, add the Power BI Service permission: Dataset.ReadWrite.All or Dataset.Read.All.
  4. Grant admin consent for the permission.
  5. Under Certificates & secrets, create a client secret. Copy the secret value immediately — it only shows once.
  6. Note your Application (client) ID and Directory (tenant) ID from the Overview page.

Step 2 — Get an access token

Use the OAuth 2.0 client credentials flow to get a bearer token.

Python example


import requests

tenant_id = "your-tenant-id"
client_id = "your-client-id"
client_secret = "your-client-secret"

token_url = f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token"
token_data = {
    "grant_type": "client_credentials",
    "client_id": client_id,
    "client_secret": client_secret,
    "scope": "https://analysis.windows.net/powerbi/api/.default"
}

response = requests.post(token_url, data=token_data)
access_token = response.json()["access_token"]

PowerShell example


$body = @{
    grant_type    = "client_credentials"
    client_id     = "your-client-id"
    client_secret = "your-client-secret"
    scope         = "https://analysis.windows.net/powerbi/api/.default"
}
$token = Invoke-RestMethod -Method Post `
  -Uri "https://login.microsoftonline.com/your-tenant-id/oauth2/v2.0/token" `
  -Body $body
$accessToken = $token.access_token

Step 3 — Find your dataset ID

You need the dataset ID to call the Execute Queries endpoint.

  1. In Power BI Service, open the workspace containing your dataset.
  2. Click the dataset name → Settings.
  3. The URL contains the dataset ID: .../datasets/{datasetId}/settings. Copy that GUID.

Alternatively, call the GET /v1.0/myorg/datasets endpoint to list all datasets and find the ID programmatically.

Step 4 — Execute a DAX query

Send a POST request with your DAX query in the request body.

Python example


dataset_id = "your-dataset-id"
headers = {
    "Authorization": f"Bearer {access_token}",
    "Content-Type": "application/json"
}
payload = {
    "queries": [
        {
            "query": "EVALUATE SUMMARIZE(Sales, Sales[Region], \"Total\", SUM(Sales[Amount]))"
        }
    ],
    "serializerSettings": {
        "includeNulls": True
    }
}
url = f"https://api.powerbi.com/v1.0/myorg/datasets/{dataset_id}/executeQueries"
response = requests.post(url, headers=headers, json=payload)
data = response.json()

The response returns a JSON object with a results array. Each result contains a tables array with rows.

API limits and how to work around them

  • 100,000 row limit — use TOPN or WHERE filters in your DAX query. Paginate by filtering on a surrogate key.
  • 120-second timeout — optimize your DAX query. Add summary tables or aggregations to the model if queries are slow.
  • One EVALUATE per request — for multiple queries, make separate API calls or use UNION to combine results in a single EVALUATE.
  • Rate limits — the API enforces per-workspace call limits. Use exponential backoff for retry logic in production pipelines.

XMLA endpoint: an alternative for larger datasets

For Premium or Fabric-licensed workspaces, use the XMLA endpoint instead of the REST API for larger query volumes.

  • The XMLA endpoint accepts MDX and DAX queries via Analysis Services client libraries.
  • No 100,000 row limit at the API layer — limits depend on dataset capacity.
  • Connect with SQL Server Management Studio (SSMS), Tabular Editor, or Python's adodbapi library.
  • XMLA read access requires a Power BI Premium Per User (PPU) or Premium capacity workspace.

Frequently asked questions

Do I need Power BI Premium to use the Execute Queries API?

No. The Execute Queries endpoint works with Pro and PPU licenses. Premium is not required. However, the XMLA endpoint — a more powerful alternative — does require Premium or Fabric capacity.

Can I use SQL instead of DAX to query a Power BI dataset?

Not through the REST API. The Execute Queries endpoint accepts DAX only. If you need SQL, connect through the XMLA endpoint using a DAX or MDX client, or query the underlying source database directly.

Can a service principal call the Power BI API?

Yes. Register an Azure AD app, grant it Dataset.Read.All permission, and add the service principal to the Power BI workspace as a member or admin. Enable service principal access in the Power BI admin portal under Tenant settings.

How do I handle the 100,000 row limit?

Filter your DAX query to return only the rows you need for each call. For large exports, paginate by filtering on an ID column: first call returns rows 1–100,000, second call returns rows 100,001–200,000, and so on.

Is there a way to stream real-time data from Power BI via the API?

Yes, but through a different API: the Push Datasets API. You push data into Power BI in real time from your system. For reading data out of Power BI in real time, use the XMLA endpoint with a streaming dataset or query the underlying source system directly.

Talk to a Power BI integration architect

EPC Group architects design Power BI API integrations, data pipelines, and embedded analytics for enterprise clients. Call (888) 381-9725 or request a 30-minute discovery call.

Why Organizations Choose EPC Group

EPC Group is a Houston-based Microsoft consulting firm with 29 years of enterprise implementation experience and over 10,000 successful deployments across Power BI, Microsoft Fabric, SharePoint, Azure, Microsoft 365, and Copilot. We serve organizations across all industries including Fortune 500, federal agencies, healthcare, financial services, government, manufacturing, energy, education, retail, technology, and global enterprises.

What sets EPC Group apart is our governance-first approach. Every engagement begins with a security and compliance assessment. Our team of senior architects brings hands-on delivery experience across HIPAA, SOC 2, FedRAMP, and CMMC environments. We own outcomes, not hours.

  • Fixed-fee accelerators with predictable pricing and defined deliverables
  • Senior architect engagement on every project, not rotating juniors
  • Compliance-native delivery for regulated industries
  • End-to-end coverage from strategy through 24/7 managed services
  • 11,000+ enterprise engagements refined into repeatable, risk-controlled patterns

Call (888) 381-9725 or email contact@epcgroup.net for a free assessment.

Power BI Strategy: 2026 Considerations for How To Get Data From Power BI Dataset Via An Api

Power BI capacity sizing in 2026 starts with the F-SKU economics: F2 ($263/mo) covers small workloads with up to 4 GB of memory and roughly 30 reports, F4 ($526/mo) handles a typical mid-market deployment with semantic-model refresh windows under 10 minutes, and F64 ($5,257/mo) is the sweet spot for enterprises consuming Power BI alongside Microsoft Fabric data engineering, lakehouse storage, and real-time intelligence. Capacity right-sizing should be revisited every 90 days because Microsoft adjusts F-SKU memory allocations, paginated report performance, and Direct Lake mode availability with each major service update.

Direct Lake mode has changed the economics of enterprise Power BI in 2026: instead of importing data into Vertipaq, semantic models now query OneLake-resident Parquet files at near-Import-mode performance without the refresh-window cost. For a Fortune 500 finance organization migrating from a 30-minute Import-mode refresh, the equivalent Direct Lake model typically queries fact data in under 800 ms while removing the entire refresh-orchestration job from Azure Data Factory.

Decision factors EPC Group evaluates

  • Capacity sizing decision (F2/F4/F64+) tied to peak concurrent users and refresh window
  • Copilot grounding quality assessment of semantic-model metadata
  • Direct Lake mode adoption for Fabric-resident semantic models
  • License optimization audit (Pro vs Premium Per User vs F-SKU)
  • Row-level security via service principal authentication

See related EPC Group services at /services or schedule a discovery call at /contact.