Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GET tables method is not supported for this dataset - not implemented

Tags:

c#

powerbi

I am trying to use the API to query the set of tables associated with a given dataset.

This works correctly on the sample dataset and on the dataset I 'created' through the API.

But, it does not work with one of my existing datasets that was tied to an SQL datasource. I would not think that should matter, because the data is already set up within PowerBI.

It may be that it has some rows in it that it does not understand, but the error message is not very informative:

StatusCode: 501, ReasonPhrase: 'Not Implemented'

    public static void PowerBiMain()
    {
        token = AccessToken();
        var datasetId = GetDatasets().value.GetDataset(datasetName).Id;
        var tables = GetTables(datasetId);
    }

        public static Tables GetTables(string datasetId)
        {
            Tables response = null;
            try
            {
                var request = DatasetRequest(String.Format("{0}/{1}/tables", powerBiApiUrl, datasetId), "GET", token);

                var responseContent = GetResponse(request);

                var json = new JavaScriptSerializer();
                response = (Tables)json.Deserialize(responseContent, typeof(Tables));
            }
            catch (Exception ex)
            {
                Console.WriteLine("Data: "+ex.Data);
                Console.WriteLine("Message: " + ex.Message);
                Console.WriteLine("Source: " + ex.Source);
                Console.WriteLine("TargetSite: " + ex.TargetSite);
                Console.WriteLine("StackTrace: " + ex.StackTrace);
            }
like image 272
Turgut Kanceltik Avatar asked May 06 '16 08:05

Turgut Kanceltik


1 Answers

I have encountered this problem too, but my research shows that unless the dataset was created through the Power BI Rest API, you cannot list the tables or push data to the dataset. This is unfortunate, hopefully this will change with the ongoing speedy evolution Power BI continues to go through, but I can think of reasons why it won't.

One of the biggest side effects of this is you miss out on using measures on a dataset created through the Rest API.

https://community.powerbi.com/t5/Developer/REST-API-and-Power-BI-Desktop/td-p/20891

https://msdn.microsoft.com/en-us/library/mt203556.aspx

like image 114
Brian Avatar answered Nov 15 '22 09:11

Brian