Forum Discussion

learninggeek_01's avatar
learninggeek_01
Regular Visitor
10 months ago
Solved

Updating Schedule refresh for Power BI Report

Hi, As we know, Schedule refresh for Power BI report could be set manually on the UI. If we are trying to automate the setup of schedule refresh on a report instead of manually entering it, what ar...
  • v-achippa's avatar
    v-achippa
    10 months ago

    Hi learninggeek_01,

     

    Cache refresh plans apply only to Paginated reports, not to PBIX reports.
    For power bi(.pbix) reports use Refresh plans, which are managed separately through the Power BI Report Server REST API.

    For your reference below is the official documentation:

    https://learn.microsoft.com/en-us/power-bi/report-server/rest-api

     

    Below is a simple power shell code to create a refresh plan for a PBIX report using the REST API:

    $serverUrl = "https://<your-server>/reports/api/v2.0"
    $reportPath = "/Sales Reports/SalesPerformance"
    $report = Invoke-RestMethod -Uri "$serverUrl/CatalogItems?path=$([uri]::EscapeDataString($reportPath))" -UseDefaultCredentials
    $reportId = $report.value[0].Id

    $body = @{
    "@odata.type" = "#Model.RefreshPlan"
    "Name" = "Daily Refresh"
    "Enabled" = $true
    "StartDate" = (Get-Date "2025-10-14T02:00:00Z")
    "Recurrence" = @{
    "@odata.type" = "#Model.DailyRecurrence"
    "DaysInterval" = 1
    }
    } | ConvertTo-Json -Depth 10

    Invoke-RestMethod -Uri "$serverUrl/CatalogItems($reportId)/RefreshPlans" `
    -Method POST -ContentType "application/json" `
    -UseDefaultCredentials -Body $body

     

    Thanks and regards,

    Anjan Kumar Chippa