Skip to content

Hourly

Get an email when a dataset refresh fails

You hear about a failed refresh once, before anyone reads yesterday's numbers.

Runs
Hourly
Apps
Power BI
AI
Not needed
Access
read (workspace Member)

Send this to your assistant

Create a ClickRuntime automation: every hour, check the datasets in my Power BI Finance workspace and email me if the latest refresh of any of them failed, once per failure.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A finance lead opens the Monday revenue report in Power BI and the numbers match last Friday. The scheduled dataset refresh failed over the weekend because a database password was rotated or a gateway went offline, and Power BI only records that in refresh history. Nobody gets pushed a message, so decisions get made on stale figures.

Every hour, ClickRuntime checks each dataset in your workspace, reads its latest refresh history entry and sends an alert when the status is Failed. It remembers which failures it already reported, so a dataset that stays broken for a day does not produce twenty-four identical messages. The alert names the dataset and when the attempt failed.

BI owners who support many reports for people outside the data team gain the most, since those viewers will never notice a stale dataset themselves.

What you get out of it

  • Stale numbers stop reaching decision makers

    When a refresh fails, executives keep reading the last good data without knowing it. A prompt alert lets you fix the credentials and refresh before the Monday meeting rather than correcting a decision afterwards.

  • The failing dataset is named

    The alert says which dataset failed and when. In a workspace with dozens of datasets that saves the trip through every refresh history page, and it points straight at the gateway or credential that broke.

  • One alert per failure, not a flood

    Because the last reported failure is remembered, a persistent problem produces a single message instead of hourly repeats. People keep reading the alerts rather than filtering them into a folder they never open.

  • Credential expiry gets caught early

    Expired passwords and rotated keys are the usual cause of refresh failures. Hourly checks mean a rotation on Friday afternoon is noticed that evening, not discovered when a client asks why the dashboard is wrong.

  • Report owners are no longer the monitoring tool

    Analysts often open reports every morning just to check they refreshed. Handing that check to an hourly alert returns the time and removes the dependence on whoever happens to look first.

How it works

What happens, step by step

  1. Every hour, ClickRuntime lists the datasets in your Power BI workspace and checks each one's latest refresh.

  2. It picks out refreshes that failed and skips any it has already told you about.

  3. You get one email per failure with the dataset name, when it failed and the error, before anyone reads yesterday's numbers.

Before it runs live

  • Connect Power BI

What you get

RunsHourly
Get an email when a dataset refresh failstoday, 9:00Succeeded
Email · Power BI refresh failedFinance actuals: failed at 2026-10-19T06:02 {"errorCode":"ModelRefresh_ShortMessage_CredentialsNotSpecified"}

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Power BI steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
dataset_refresh_failure_alert.pyexample
from clickruntime import on_trigger, credentials, http, notify, state

GROUP_ID = "f089354e-8366-4e18-aea3-4cb4a3a50b48"  # Finance workspace
API = f"https://api.powerbi.com/v1.0/myorg/groups/{GROUP_ID}/datasets"

@on_trigger
def run(event):
    headers = {"Authorization": f"Bearer {credentials.connection('power-bi', 'work')}"}
    seen = state.get("alerted") or {}
    failures = []
    for ds in http.get(API, headers=headers).json()["value"]:
        if not ds.get("isRefreshable"):
            continue
        last = (http.get(f"{API}/{ds['id']}/refreshes", params={"$top": 1}, headers=headers).json()["value"] or [{}])[0]
        if last.get("status") == "Failed" and seen.get(ds["id"]) != last.get("requestId"):
            failures.append(f"{ds['name']}: failed at {last.get('endTime', '')[:16]}\n  {last.get('serviceExceptionJson', '')[:300]}")
            seen[ds["id"]] = last.get("requestId")
    if failures:
        notify.email_me(f"{len(failures)} Power BI refreshes failed", "\n".join(failures))
        state.set("alerted", seen)
    return {"failures": len(failures)}

FAQ

Common questions

Does it need Power BI Premium?
Refresh history is available through the Power BI REST API for datasets in any workspace the connected account can access, including shared capacity. Your account needs to be a member or admin of the workspace for the dataset list and refresh history to come back.
Which refresh statuses trigger an alert?
A refresh with status Failed triggers the alert. Completed and in-progress refreshes are ignored, as are those that were cancelled or disabled. Power BI returns the error message with a failed refresh, so the alert can include it.
Can it monitor only certain datasets?
Yes. The dataset list can be limited by name or ID, which helps when a workspace holds test datasets that fail often and do not matter. Say which ones count, and the alert will skip all the others.
What permissions does it need?
read (workspace Member). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (hourly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get an email when a dataset refresh fails” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.