# Get Power BI Dataset Refresh History using Python

> I explain how to get dataset refresh history from Power BI using Python. For this method, you need to be a tenant Admin, and it is limited to only 7 days or 60 refreshes, per dataset. For more history, you need another API or method.

- URL: https://data-goblins.com/get-power-bi-refresh-history-python
- Author: Kurt Buhler
- Published: 2022-05-09
- Topic: Admin and governance

# USE PYTHON TO GET DATA FROM POWER BI APIs

*…such as limited dataset refresh history for datasets a service principle has access to*

---

## IN THIS ARTICLE

- **Get Dataset Refresh History** from Power BI Admin API using Python
*Note:* This is limited to the **last 7 days or 60 refreshes, per dataset**! If you want a long-running refresh history, you need to employ other methods, such as Azure Log Analytics, another endpoint, etc.

<figure class="dg-figure"><img src="https://images.data-goblins.blog/2025/12/refresh-history-python-output.png" alt=" Example result dataframe for dataset refreshes obtained with the Admin API. The result is not a fully normalized dataframe, yet. "><figcaption>Example result dataframe for dataset refreshes obtained with the Admin API. The result is not a fully normalized dataframe, yet.</figcaption></figure>

---

## HOW TO SET IT UP?

I wrote a post about setting up a Service Principal, permissions & settings to get you started, as well as explaining the Authentication. You can [**find that post, here**.](https://data-goblins.com/power-bi-api-python)

---

---

*Code is provided as-is with no guarantees or warranties of any kind. Something I did quickly in spare time.*

---
