Sometimes you need a report to refresh not on a fixed schedule, but when a specific event occurs.
A common example is when the table behind your semantic model is updated by a trigger or an ETL process that finishes at unpredictable times. In that case, a standard scheduled refresh is not enough.
I ran into exactly this scenario in one of my projects. A monitoring system was collecting CPU load metrics and writing rows into a database table only when CPU usage exceeded a threshold. As soon as those rows appeared, the report needed to be refreshed immediately.
With this kind of logic, you cannot reliably predict the refresh time in advance. CPU load may stay normal for several days, or it may cross the threshold multiple times in one day. For scenarios like this, triggering a refresh through the API is a much better fit.
In this article, I will show a simple and reliable method:
- Create a Cache Refresh Plan for the report
- Get the refresh plan ID
- Trigger it with a single PowerShell command
Power BI Report Server exposes REST API operations for Cache Refresh Plans, including getting plans, executing a plan immediately, and retrieving execution history.
Read more...