sql-bi / Pbi-PushDataset

Validate and translate regular Tabular models in Push Datasets, also providing helper functions to clear, populate, and simulate real-time transactions.
MIT License
49 stars 15 forks source link

generate command model not compatible #1

Closed daniel-castro-maersk closed 3 years ago

daniel-castro-maersk commented 3 years ago

When generating the model using the Console App, it saves a model which if we try to post the data via Power BI API documentation playground (https://docs.microsoft.com/en-us/rest/api/power-bi/push-datasets/datasets-post-dataset), and in body we use the output content, we get the following message from Power BI API: { "error": { "code": "BadRequest", "message": "Bad Request", "details": [ { "message": "The property 'compatibilityLevel' does not exist on type 'Microsoft.PowerBI.ServiceContracts.Api.Dataset'. Make sure to only use property names that are defined by the type.", "target": "dataset" } ] } }

Comparing both Model.bim and out.bim they look like the same, meaning the output result of the generate command does not look like the correct content/intended.

Running the check command it validates de Model.bim successfully.

Can you help?

marcosqlbi commented 3 years ago

You should post the data using the function included in the library. The file generated cannot be sent directly to the API. Take a look at the code of CreatePushDataset here: https://github.com/sql-bi/Pbi-PushDataset/blob/8d756705e267e00003596955359c9fb4716c8293/Sqlbi.PbiPushDataset/PbiConnection.cs#L250

The easiest way to test the system is by following the instructions in this article: https://www.sqlbi.com/articles/implementing-real-time-updates-in-power-bi-using-push-datasets-instead-of-directquery/