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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TBardien
Helper I
Helper I

API call Datasets Get Tables DO NOT WORK

I am trying to fetch Tables for a dataset from the API.

I have tried 

client.Datasets.GetTablesInGroupAsync(
client.Datasets.GetTablesAsync(
client.Datasets.GetTablesInGroup(

none of them work. They all throw the same error: Operation returned an invalid status code 'NotFound'

How do I go about fetching the Tables for a dataset?

4 REPLIES 4
ed-freeman
Helper II
Helper II

As @lbendlin has said, it seems like you're using the Push Datasets API, which won't work if you're using just a "standard" dataset.

If the dataset resides in a workspace assigned to a Premium (or Embedded) capacity, you can use the Tabular Object Model (TOM) or the ADOMD .NET Client Library (that one is .NET Core, but there are .NET Framework versions) to speak to the underlying Analysis Services (AS) model through the XMLA endpoint. You can see this blog for an example on how to query measures for an AS model - it's an example using Azure Analysis Services, but the same logic applies to the Power BI XMLA endpoint. It's also querying measures, not tables - but the same logic applies.

If you're not using Premium/Embedded, your options are a bit more limited. One far-from-ideal way to get the Table names would be to unzip the pbix file and look in the DiagramLayout file, which lists all the tables in the dataset. But without knowing what exactly you're trying to do in your scenario, I'm not sure whether that's a feasible solution.

Hope this helps,

Ed

lbendlin
Super User
Super User

Try it out in the sandbox.

 

https://docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_gettablesingroup

 

Worked for me. NOTE: This call is only working with Push datasets. 

@lbendlin  What is the difference between a dataset and a push dataset?

Dataset : you own it and manipulate it via .pbix. you can selectively change its data

Push dataset: Azure owns it and you can only post to it and query it. There is no .pbix. you cannot change its data after posting/pushing. Only full delete and start over.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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