Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
SourabhW
New Member

How to read KPI Data from PowerBI Report using REST API

Hi Everyone,

 

I'm currently working on Automating a process where I need to read KPI values from a Power BI report preferably using the Power BI Rest API. I wanted to check if this is possible, and if so, what are the steps required to set it up.

Specifically, I am looking to:

1. Access the KPI visuals from a published Power BI report.

2. Read or extract the current visuals programmatically.

I've seen the REST API documentation, but its not clear whether it supports reading visual-level data like KPIs. If anyone has experience with this or can point me to right approach, I'd really appreciate it.

 

Thanks in advance!

2 ACCEPTED SOLUTIONS
ibarrau
Super User
Super User

Hi. The way to go here would be query the dataset with dax. First, understando how to get that value. You can open the Performance Analyzer, run it, open the kpi visual and copy query. That will copy to clipboard a DAX query that returns the number of the KPI. You can use it for the request to keep the context you are seeing. You can also create the DAX query if you know what you want.

Once you have the DAX that would return that data, you can use this request of the rest api: https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries-in-group

If this is the first time using Power Bi Rest API check this out: https://blog.ladataweb.com.ar/post/740398550344728576/seteo-powerbi-rest-api-por-primera-vez

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

v-veshwara-msft
Community Support
Community Support

Hi @SourabhW ,

Thanks for your question.

As mentioned by @ibarrau , the Power BI REST API does not provide direct access to visuals like KPIs. However, you can retrieve the data behind the KPI by using the ExecuteQueries REST API with a DAX query.

To do this:

  1. Open your report in Power BI Desktop.

  2. Enable Performance Analyzer (View > Performance Analyzer), start recording, and interact with the KPI visual.

  3. Use Copy Query to get the DAX query used by the KPI.

  4. Use the Execute Queries in Group API to run this DAX query and retrieve the data programmatically. 

    If you're setting up the API for the first time, the blog post shared by Ibarrau is a helpful reference.

    Additionally you can refer to: Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn

Hope this helps. Please reach out for further assistance.

Please consider marking the helpful reply as Accepted Solution to assist others with similar issues and a kudos would be appreciated.

Thank you.

View solution in original post

6 REPLIES 6
SourabhW
New Member

Thanks @ibarrau and @v-veshwara-msft for the detail explanation.

v-veshwara-msft
Community Support
Community Support

HI @SourabhW ,

We’re following up once more regarding your query. If it has been resolved, please mark the helpful reply as the Accepted Solution to assist others facing similar challenges.

If you still need assistance, please let us know.
Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @SourabhW ,

Following up to see if your query has been resolved. If any of the responses helped, please consider marking the relevant reply as the 'Accepted Solution' to assist others with similar questions.

If you're still facing issues, feel free to reach out.

Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @SourabhW ,

Just checking in to see if you query is resolved and if any responses were helpful. If so, kindly consider marking the helpful reply as 'Accepted Solution' to help others with similar queries. 

Otherwise, feel free to reach out for further assistance.

Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @SourabhW ,

Thanks for your question.

As mentioned by @ibarrau , the Power BI REST API does not provide direct access to visuals like KPIs. However, you can retrieve the data behind the KPI by using the ExecuteQueries REST API with a DAX query.

To do this:

  1. Open your report in Power BI Desktop.

  2. Enable Performance Analyzer (View > Performance Analyzer), start recording, and interact with the KPI visual.

  3. Use Copy Query to get the DAX query used by the KPI.

  4. Use the Execute Queries in Group API to run this DAX query and retrieve the data programmatically. 

    If you're setting up the API for the first time, the blog post shared by Ibarrau is a helpful reference.

    Additionally you can refer to: Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn

Hope this helps. Please reach out for further assistance.

Please consider marking the helpful reply as Accepted Solution to assist others with similar issues and a kudos would be appreciated.

Thank you.

ibarrau
Super User
Super User

Hi. The way to go here would be query the dataset with dax. First, understando how to get that value. You can open the Performance Analyzer, run it, open the kpi visual and copy query. That will copy to clipboard a DAX query that returns the number of the KPI. You can use it for the request to keep the context you are seeing. You can also create the DAX query if you know what you want.

Once you have the DAX that would return that data, you can use this request of the rest api: https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries-in-group

If this is the first time using Power Bi Rest API check this out: https://blog.ladataweb.com.ar/post/740398550344728576/seteo-powerbi-rest-api-por-primera-vez

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.