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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
saranrajk
Helper II
Helper II

how to get list of dataset and datasources using Power BI report server rest API?

Hi,

 

I'm trying to get data from power BI report server through rest API, 

I can get list of kpi, catalog items and so on.

 

I have attached my data sources image and and slo my report server home image

But I'm not be able to get the data sets and data sources.

When I call the following url I'm getting the empty array.

{
  "@odata.context":"http://<server_name>/Reports/api/v2.0/$metadata#DataSources","value":[
    
  ]
}

Please see this image If you wanna view my power bi report server homePlease see this image If you wanna view my power bi report server home

Please see this imagePlease see this image

8 REPLIES 8
d_gosbell
Super User
Super User

The details of the endpoint your are calling don't seem to have pasted in correctly, but the picture you are showing looks like the data sources for a specific PBIX file.

 

To get those details you would have to use the /PowerBIReports endpoint to get the ID of your report, then you could call the /PowerBIReports({Id})/DataSources endpoint (see https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/PowerBIReports/GetPowerBIReportDataSources)

Yes, It's a data sources but even if I url the following url to get the list of data sources I'm getting empty array.

http://<server name>/Reports/api/v2.0/DataSources

Where I can find data sets,I'm seeing only data sources.

 

Yes, so like I mentioned earlier you need to use the /PowerBIReport endpoint to get the data sources for a pbix file.

 

The endpoint you are using only returns shared data sources for paginated reports.

 


@saranrajk wrote:

Where I can find data sets,I'm seeing only data sources.

 


It depends on what you mean by "data sets" in Power BI Report Server terminology "shared data sets" are created for paginated reports using the Visual Studio designers. Unlike the powerbi.com service, Power BI Report Server does not currently support the ability to connect other reports or reporting tools to the "data set" inside another pbix file if this is what you are trying to do. 

So, you are saying that data sets is not available in Power BI report server right?

If so, I have seen the API to get datasets and get data from the datasets in swagger hub.

https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/DataSets/GetDataSets

 If I'm using this API I'm getting an empty array.

And one more thing that, how can I get data from the data sources.

Please refer the below link, he is getting data through API.

https://www.c-sharpcorner.com/article/rest-apis-for-power-bi-report-server/

 

 


@saranrajk wrote:

So, you are saying that data sets is not available in Power BI report server right?

If so, I have seen the API to get datasets and get data from the datasets in swagger hub.

https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/DataSets/GetDataSets

 If I'm using this API I'm getting an empty array.

And one more thing that, how can I get data from the data sources.

Please refer the below link, he is getting data through API.

https://www.c-sharpcorner.com/article/rest-apis-for-power-bi-report-server/

 


So both that API endpoint and the article you reference require that you have created a Share Data Set object using the Visual Studio Reporting Services designer and then have deployed that to your server. Once you have done that you will be able to list any of these that you have deployed and connect to them as demonstrated in that article.

Oh, Okay thanks for the information and I also wanna know how to get data from the data sources.

Is that possible?

And If I created the shared data set, can I able acces data only from the particular data or I can access data based on data modelling.

for example I have one fact table(sales) and one dimension table(city) can I get data on sales by city through API, is that possible? 


@saranrajk wrote:

Oh, Okay thanks for the information and I also wanna know how to get data from the data sources.

Is that possible?


No this is not possible on Power BI Report Server

 


And If I created the shared data set, can I able acces data only from the particular data or I can access data based on data modelling.

for example I have one fact table(sales) and one dimension table(city) can I get data on sales by city through API, is that possible? 


The shared data sets are basically just a stored SQL SELECT statement that you can execute via the API. They are not a data model. You cannot use them for ad-hoc queries.

Thank you so much for the clarification man.

And one more thing I wanna know, Please watch the video and somehow he is getting data from Power BI service, do you have any idea about this.

How can I get data like this?

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.