title: Scheduled refresh dataset in Power Bi from Power Automate (Microsoft Flow)
body: <p>I have a Power BI project where the data is stored in sql server through DirectQuery. I would like to schedule the update of the report and therefore of the data, through Microsoft Automate (Flow).</p>
  <p><a href="https://i.stack.imgur.com/xruVZ.png" rel="nofollow noreferrer">Flow scheduling</a></p>
  <p>When I run the schedule, however, I get this error message &quot;Invalid dataset. This API can only be called on a Model-based dataset power bi&quot;.</p>
  <pre><code>{
    &quot;error&quot;: {
      &quot;code&quot;: &quot;InvalidRequest&quot;,
      &quot;message&quot;: &quot;Invalid dataset. This API can only be called on a Model-based dataset&quot;
    }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/srwxN.png" rel="nofollow noreferrer">Immage Error</a></p>
  <p>Why?</p>