Refresh scheduler

From markus41/claude · View interactive version

Refresh scheduler is an AI agent skill from the GitHub repository markus41/claude. Design Power BI dataset refresh scheduling, on-premises gateway configuration, and failure alerting to ensure dashboards display current data for operational decision-making.

How to use this skill

Skill file

Refresh Scheduler

Produce a complete Power BI refresh schedule and gateway configuration specification. Every dataset in the Power BI workspace gets an explicit refresh schedule, failure alerting configuration, and gateway assignment. No dataset is left with default settings.

Refresh Frequency Selection

Choose the refresh frequency based on how often the data changes and how stale data would be tolerated:

| Report Type | Recommended Refresh | Maximum Staleness | Mode |

|------------|--------------------|--------------------|------|

| Executive dashboard (monthly KPIs) | Daily at 6 AM | 24 hours | Import |

| Operational report (daily pipeline review) | Every 3 hours during business hours | 3 hours | Import |

| Real-time operations (claims intake, loan status) | DirectQuery (no refresh needed) | Near-real-time | DirectQuery |

| Weekly management report | Sunday night at 11 PM | 7 days | Import |

| Monthly board report | 1st of month at 4 AM | 1 month | Import |

Business hours constraint: Schedule refreshes at off-peak hours to avoid competing with user report access and database peak load.

Maximum refreshes per day: Power BI Pro supports 8 refreshes per day per dataset. Power BI Premium supports 48 per day. Plan the schedule within these limits.

Dataset Refresh Schedule

Define a refresh schedule for every dataset in the workspace:

| Dataset Name | Refresh Frequency | Times (ET) | Days | Max Retries | Notes |

|-------------|------------------|-----------|------|-------------|-------|

| Agency Production Dashboard | Daily | 6:00 AM | Mon–Sun | 3 | Depends on AMS nightly batch completing by 4 AM |

| Claims Operations | Every 3 hours | 6AM, 9AM, 12PM, 3PM, 6PM | Mon–Fri | 2 | No weekend refresh — claims staff not working |

| Renewal Pipeline Tracker | Daily | 5:30 AM | Mon–Fri | 3 | Weekends not needed |

| Monthly Board Report | Monthly | 4:00 AM | 1st of month | 3 | Run manually if 1st falls on weekend |

| Producer Scorecard | Daily | 6:00 AM | Mon–Fri | 3 | |

| KPI Targets Dataset | On-demand | Manual | N/A | 1 | Targets updated by Finance monthly — manual trigger |

Timezone: All schedules are entered in the dataset's configured timezone. Set the dataset timezone in Power BI Service > Settings > Datasets > Scheduled refresh > Time zone. Use the firm's primary timezone (e.g., US Eastern).

On-Premises Data Gateway Configuration

Required for any dataset connecting to: SQL Server (on-premises), local file shares, SharePoint on-premises, or any source behind the corporate firewall.

Gateway cluster architecture:

Gateway Cluster: [FirmName]-PBI-Gateway-Cluster
  Primary node: [server-name-1] (active)
  Secondary node: [server-name-2] (standby — failover)

Use a two-node cluster for high availability. If the primary node fails, Power BI automatically routes to the secondary node with no interruption.

Server requirements:

Gateway service account:

Gateway installation checklist:

Data source credentials in the gateway:

| Data Source | Connection String | Authentication | Credential Owner |

|-------------|-----------------|----------------|-----------------|

| AMS SQL Server | Server=[ams-server]; Database=[AMSProd] | Windows Auth (service account) | IT Admin |

| Reporting SQL View | Server=[rpt-server]; Database=[Reports] | SQL Auth (separate read-only user) | IT Admin |

Credentials are stored encrypted in the gateway. Rotate SQL Auth passwords every 90 days and update the gateway data source credentials in Power BI Service > Manage Connections and Gateways.

Failure Alerting

Configure alerts so refresh failures are caught and addressed before stakeholders notice stale data.

Alert channels:

  1. Power BI Service email notification: Enabled for all datasets. Sends to the dataset owner.
  2. Microsoft Teams notification: Power Automate flow posts to the IT Operations Teams channel when any dataset refresh fails.
  3. Escalation: If the same dataset fails 3 consecutive refreshes, an escalation email goes to the BI lead and department manager.

Power BI Service email configuration:

For each dataset in Power BI Service > Settings > Scheduled refresh:

Power Automate failure alert flow (build this flow):

Trigger: Power BI — Refresh a dataset (status trigger)
  When dataset refresh fails:

Action 1: Post to Teams channel
  Team: IT Operations
  Channel: BI-Alerts
  Message: 
    "Dataset refresh FAILED:
    Dataset: @{triggerOutputs()?['body/datasetName']}
    Workspace: @{triggerOutputs()?['body/workspaceName']}
    Failure time: @{triggerOutputs()?['body/refreshStartTime']}
    Error: @{triggerOutputs()?['body/serviceExceptionJson']}
    Action required: Check gateway status and data source connectivity."

Action 2: Send email
  To: bi-support@[firm].com
  Subject: [ACTION REQUIRED] Power BI Refresh Failure — @{triggerOutputs()?['body/datasetName']}
  Body: [Same details as Teams message with link to the dataset settings page]

Alert on repeated failures (add to the flow):

Condition: If consecutive failure count > 3
  (Track failure count in SharePoint list: DatasetName, FailureCount, LastFailureTime)
  Then: Also send email to bi-lead@[firm].com and [department manager email]

Dataflow Refresh Design

If Power BI dataflows are used (recommended for shared transformation logic):

Dataflow refresh must complete before dependent dataset refresh:

Refresh sequence:
  1. Dim_Clients dataflow — 5:00 AM (runtime ~5 min)
  2. Dim_Producers dataflow — 5:00 AM (parallel with Dim_Clients)
  3. Fact_Policies dataflow — 5:10 AM (after dimensions complete)
  4. Agency Production dataset — 5:45 AM (after all dataflows complete, buffer 25 min)
  5. Producer Scorecard dataset — 5:45 AM (parallel with step 4)

Configure dataflow enhanced refresh: In Premium workspaces, use the Enhanced Refresh API to trigger dataset refreshes programmatically after the dataflow completes, instead of relying on scheduled time buffers.

Programmatic Refresh (Premium / XMLA)

For Power BI Premium workspaces, use the REST API to trigger refresh programmatically instead of relying on scheduled times:

POST refresh via REST API (called from Power Automate or Azure Data Factory):

POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/refreshes
Authorization: Bearer {service principal token}
Content-Type: application/json

{
  "notifyOption": "MailOnFailure",
  "type": "Full",
  "commitMode": "transactional",
  "objects": [
    { "table": "Fact_Policies" }
  ]
}

Use this pattern to: trigger a refresh immediately after the AMS nightly batch job completes (not at a fixed time), avoid unnecessary refreshes when source data has not changed, and control the refresh order precisely.

Check refresh status (poll until complete):

GET https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/refreshes?$top=1

Output Format

Deliver as:

  1. Dataset refresh schedule table (all datasets with frequency, times, days, retry count)
  2. Gateway cluster specification (server names, requirements, service account)
  3. Data source credentials table (source, connection string, auth type)
  4. Failure alerting configuration (email + Teams flow specification)
  5. Dataflow refresh sequencing diagram (if dataflows are used)
  6. Programmatic refresh API spec (if Premium workspace)
  7. Monitoring dashboard spec (what to show on an IT operations screen: last refresh time, next scheduled refresh, success/failure count for trailing 7 days)
  8. Post-deployment checklist (verify gateway is online, test-trigger each dataset manually, verify failure alert fires)
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.