cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft
Microsoft

Get Table information from dataset Programmatically

Hi All,

 

Is there a way to programatically get the information of datasource & tables used in a dataset (like some kind of metadata). 
I saw there is a GetDataSet API, but that works on the datasets that are published using REST API. It will be practically impossible for us to publish a report using REST API given the amount of data we have. 

Any suggestions please?  

13 REPLIES 13
Highlighted
Community Champion
Community Champion

Re: Get Table information from dataset Programmatically

You can use any XMLA client (like SSMS, DAX Studio, ALM Toolkit etc) to connect to the XMLA endpoint of the dataset (assuming, of course, that you have access to the dataset) and pull down all the meta data.

Highlighted
Microsoft
Microsoft

Re: Get Table information from dataset Programmatically

That is good information. Thanks @lbendlin . I see that it is only supported for PowerBI premium subscriptions. 
Currently we don't have PowerBI premium. Do you know of a way which can work for us with Standard PowerBI subscription & workspace.

Highlighted
Community Champion
Community Champion

Re: Get Table information from dataset Programmatically

Apologies, i did not qualify that. I have no experience outside of Premium. Maybe you need to be made a workspace member?

Highlighted
Microsoft
Microsoft

Re: Get Table information from dataset Programmatically

So I got hold of a premium workspace and am able to connect to the XMLA endpoint. 
So far, I could get information like tables and columns from dataset perspective.

We want to actually find the source table information, not the ones created in powerbi report/dataset. Sorry if that was not clear in my initial post.
@lbendlin is there a way to get the source table information and the actual queries which are used to create the dataset tables.

Highlighted
Community Champion
Community Champion

Re: Get Table information from dataset Programmatically

select * from $SYSTEM.TMSCHEMA_PARTITIONS

Highlighted
Microsoft
Microsoft

Re: Get Table information from dataset Programmatically

Thanks @lbendlin. I tried that at I dont see information of actual source in response. 
I still see the information about dataset tables, not the actual source SQL tables.

Highlighted
Community Champion
Community Champion

Re: Get Table information from dataset Programmatically

Now you got me really confused.  Are you after the schema information?

 

See if this blog helps you.

 

https://blog.crossjoin.co.uk/2020/07/05/why-is-power-bi-running-my-sql-query-twice/

Highlighted
Microsoft
Microsoft

Re: Get Table information from dataset Programmatically

Sorry for the confusion @lbendlin .
My need is to programatically find the list of source tables which are backing a given powerbi report.

Highlighted
Community Champion
Community Champion

Re: Get Table information from dataset Programmatically

That's what I gave you with the DMV query.  You need to take that M code and parse it. It contains the server, database and query.

 

Annotation 2020-07-17 170405.png

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.