Refresh is dataset-centric, not report-centric. Pausing a dataset stops its scheduled refresh (and any refresh triggers tied to that dataset). If multiple reports use different datasets, you’ll need to pause each of those datasets.
You can create a one-click solution by building a small automation (Power Automate flow, an Azure Function, or a simple script) that pauses all datasets in the target workspaces.
Recommended approaches:
A) Quick, scalable method: Power BI REST API
What it does: Pauses the refresh for each dataset in a workspace. Scope: Target a single workspace or multiple workspaces. How to do it: Write a small script that:
- Lists datasets in the workspace(s).
- Patches each dataset to set isRefreshPaused = true.
Optionally logs results for verification.
B) PowerShell option (uses REST under the hood)
What it does: Uses Power BI PowerShell cmdlets (or raw REST calls) to pause datasets. Pros: Familiar for many admins; easy to run from a local machine or admin server. Cons: Requires setting up the Power BI PowerShell module and token handling.
C) One-click automation (recommended for frequent needs)
Build a Power Automate flow or a small app that, when you click a button, calls the REST API to pause all datasets in selected workspaces. Pros: Truly one-click; auditable; easy to re-run or resume with another button.
Step-by-step guide (REST API approach)
Prerequisites
- Admin or dataset access that can pause refresh in the target workspaces.
- An Azure AD app registration with at least Dataset.ReadWrite.All permission (admin consent required) or use a user account with Power BI permissions.
- A way to obtain an OAuth 2.0 access token for the Power BI API.
Steps
- Get the list of datasets in a workspace
- Pause a dataset’s refresh
- Optional: Verify
- Optional: Repeat for all datasets in the workspace(s)
Iterate the patch call for every dataset in the list.
Sample Python script (ready-to-adapt)
This uses REST calls and requires you to supply an access token. It demonstrates listing datasets and pausing them in a single workspace. You can extend it to multiple workspaces as needed.
import requests, json
def get_access_token(tenant_id, client_id, client_secret): token_url = f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token" data = { "grant_type": "client_credentials", "client_id": client_id, "client_secret": client_secret, "scope": "https://analysis.windows.net/powerbi/api/.default" } resp = requests.post(token_url, data=data) resp.raise_for_status() return resp.json().get("access_token")_
def pause_datasets_in_workspace(access_token, group_id): datasets_url = f"https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets" headers = { "Authorization": f"Bearer {access_token}", "Content-Type": "application/json" }
List datasets
resp = requests.get(datasets_url, headers=headers)
resp.raise_for_status()
datasets = resp.json().get("value", [])
# Pause each dataset
for ds in datasets:
ds_id = ds.get("id")
patch_url = f"https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{ds_id}"
body = {"isRefreshPaused": True}
r = requests.patch(patch_url, headers=headers, data=json.dumps(body))
print(f"Paused dataset {ds_id}: {r.status_code} {r.text}")
Replace with your values
tenant_id = "YOUR_TENANT_ID" client_id = "YOUR_CLIENT_ID" client_secret = "YOUR_CLIENT_SECRET" group_id = "YOUR_GROUP_ID" # workspace ID
token = get_access_token(tenant_id, client_id, client_secret) pause_datasets_in_workspace(token, group_id)_
Notes:
- Implement token acquisition (OAuth 2.0 client credentials or delegated flow) to obtain access_token.
- This script pauses scheduled refresh for all datasets in the specified workspace(s). Some datasets or refresh types may behave differently; test on a non-critical workspace first.
- If you want to resume later, send isRefreshPaused = False._
Power Automate (Flow) option
- Create a Flow with a manual trigger (button).
- Action: HTTP (to call GET groups/{groupId}/datasets) to enumerate datasets.
- Apply to each dataset: HTTP PATCH to groups/{groupId}/datasets/{datasetId} with body {"isRefreshPaused": true}.
- Add steps to log results (e.g., push to a SharePoint list, Teams message, or a log file).
Advantages: Truly one-click; no code required beyond Flow setup; easy to re-run.