Reputation: 471
I have created a Power BI dataset with the power BI REST API. There are 2 tables in this dataset.
Now, I'm creating a new report with data from this dataset (with Power BI Desktop).
The problem is that the "Manage relationships" command is grayed out. I have read somewhere that I should switch from a "connected live" dataset to an import dataset, but I'm not sure it applies in this case and I did not even find how to do it yet.
So, the question is: how can one enable the "Manage relationships" command for data coming from a Power BI dataset? Is it some flag I should set to a specific value when I create the dataset with the API? Or something to do in Power BI Desktop I've been unable to find up to now?
Upvotes: 0
Views: 6616
Reputation: 13450
If you are using a dataset created using the REST API, then it must be added to the report by using Power BI Dataset
data source. This means that this is a live connection, in which the modeling is done at the data source itself (think of this as connected to a SSAS cube). In this case you have pretty limited options what you can do in the report (creating measures is pretty much everything you can do).
You can't switch to Import
in this case. For importing, you must load the data from the data source used to fill this data set and bypass it completely.
If you are missing a relationship between the tables in the dataset, you can define it when creating the dataset, with json body like this:
{
"name": "SalesData",
"defaultMode": "Push",
"tables": [
{
"name": "Customers",
"columns": [
{
"name": "CustomerId",
"dataType": "Int64"
},
{
"name": "CustomerName",
"dataType": "string"
}
],
"name": "Orders",
"columns": [
{
"name": "CustomerId",
"dataType": "Int64"
},
{
"name": "OrderDate",
"dataType": "Datetime"
},
{
"name": "Amount",
"dataType": "Double"
}
]
}
],
"relationships": [
{
"name": "FK_Orders_Customers",
"fromTable": "Orders",
"fromColumn": "CustomerId",
"toTable": "Customers",
"toColumn": "CustomerId",
"crossFilteringBehavior": "bothDirections"
}
]
}
Upvotes: 3