Push Datasets - Datasets PostDataset
Creates a new dataset on My workspace.
Required Scope
Dataset.ReadWrite.All
Limitations
This API call only supports push datasets.
POST https://api.powerbi.com/v1.0/myorg/datasets
POST https://api.powerbi.com/v1.0/myorg/datasets?defaultRetentionPolicy={defaultRetentionPolicy}
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
default
|
query |
The default retention policy |
Request Body
Name | Required | Type | Description |
---|---|---|---|
name | True |
|
The dataset name |
tables | True |
|
The dataset tables |
datasources |
The data sources associated with this dataset |
||
defaultMode |
The dataset mode or type |
||
relationships |
The dataset relationships |
Responses
Name | Type | Description |
---|---|---|
201 Created |
Created |
|
202 Accepted |
Accepted |
Examples
Push example
Sample Request
POST https://api.powerbi.com/v1.0/myorg/datasets?defaultRetentionPolicy=basicFIFO
{
"name": "SalesMarketing",
"defaultMode": "Push",
"tables": [
{
"name": "Product",
"columns": [
{
"name": "ProductID",
"dataType": "Int64"
},
{
"name": "Name",
"dataType": "string"
},
{
"name": "Category",
"dataType": "string"
},
{
"name": "IsCompete",
"dataType": "bool"
},
{
"name": "ManufacturedOn",
"dataType": "DateTime"
},
{
"name": "Sales",
"dataType": "Int64",
"formatString": "Currency"
}
]
}
]
}
Sample Response
{
"id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
"name": "SalesMarketing",
"defaultRetentionPolicy": "basicFIFO"
}
Definitions
ASMashup |
A dataset table source |
Column |
A dataset column |
Create |
A Power BI dataset |
Cross |
The filter direction of the relationship |
Dataset |
A Power BI dataset. The API returns a subset of the following list of dataset properties. The subset depends on the API called, caller permissions, and the availability of the data in the Power BI database. |
Dataset |
The dataset mode or type |
Dataset |
A Power BI user access right entry for a dataset |
Dataset |
The access right that the user has for the dataset (permission level) |
Datasource |
A Power BI data source |
Datasource |
The Power BI data source connection details. See examples in Get Datasources or Get Datasources In Group. |
Default |
The default retention policy |
Dependent |
A Power BI dependent dataflow |
Encryption |
Encryption information for a dataset |
Encryption |
Dataset encryption status |
Measure |
A Power BI measure |
Principal |
The principal type |
Relationship |
A relationship between tables in a dataset |
Row |
A data row in a dataset |
Service |
A Power BI service principal profile. Only relevant for Power BI Embedded multi-tenancy solution. |
Table |
A dataset table |
ASMashupExpression
A dataset table source
Name | Type | Description |
---|---|---|
expression |
|
The source expression |
Column
A dataset column
Name | Type | Description |
---|---|---|
dataCategory |
|
Optional. The string value to be used for the data category which describes the data within this column. |
dataType |
|
The column data type |
formatString |
|
Optional. The format of the column as specified in FORMAT_STRING. |
isHidden |
|
Optional. Whether the column is hidden. The default is |
name |
|
The column name |
sortByColumn |
|
Optional. String name of a column in the same table to be used to order the current column. |
summarizeBy |
|
Optional. The aggregate function to use for summarizing this column. |
CreateDatasetRequest
A Power BI dataset
Name | Type | Description |
---|---|---|
datasources |
The data sources associated with this dataset |
|
defaultMode |
The dataset mode or type |
|
name |
|
The dataset name |
relationships |
The dataset relationships |
|
tables |
|
The dataset tables |
CrossFilteringBehavior
The filter direction of the relationship
Name | Type | Description |
---|---|---|
Automatic |
|
Cross filtering behavior is automatically defined |
BothDirections |
|
For filtering purposes, both tables are treated as a single table. |
OneDirection |
|
For filtering purposes, the filter will be applied on the table where values are being aggregated. |
Dataset
A Power BI dataset. The API returns a subset of the following list of dataset properties. The subset depends on the API called, caller permissions, and the availability of the data in the Power BI database.
Name | Type | Description |
---|---|---|
ContentProviderType |
|
The content provider type for the dataset |
CreateReportEmbedURL |
|
The dataset create report embed URL |
CreatedDate |
|
The dataset creation date and time |
Encryption |
Dataset encryption information. Only applicable when |
|
IsEffectiveIdentityRequired |
|
Whether the dataset requires an effective identity, which you must send in a GenerateToken API call. |
IsEffectiveIdentityRolesRequired |
|
Whether row-level security is defined inside the Power BI .pbix file. If so, you must specify a role. |
IsOnPremGatewayRequired |
|
Whether the dataset requires an on-premises data gateway |
IsRefreshable |
|
Whether the dataset can be refreshed |
QnaEmbedURL |
|
The dataset Q&A embed URL |
addRowsAPIEnabled |
|
Whether the dataset allows adding new rows |
configuredBy |
|
The dataset owner |
description |
|
The dataset description |
id |
|
The dataset ID |
name |
|
The dataset name |
targetStorageMode |
|
The dataset storage mode |
upstreamDataflows |
The upstream dataflows |
|
users |
(Empty value) The dataset user access details. This property will be removed from the payload response in an upcoming release. You can retrieve user information on a Power BI item (such as a report or a dashboard) by using the Get Dataset Users as Admin API, or the PostWorkspaceInfo API with the |
|
webUrl |
|
The web URL of the dataset |
DatasetMode
The dataset mode or type
Name | Type | Description |
---|---|---|
AsAzure |
|
A dataset with a live connection to Azure Analysis Services |
AsOnPrem |
|
A dataset with a live connection to on-premises Azure Analysis Services |
Push |
|
A dataset that allows programmatic access for pushing data into PowerBI |
PushStreaming |
|
A dataset that supports data streaming and allows programmatic access for pushing data into Power BI |
Streaming |
|
A dataset that supports data streaming. For more information, see Real-time streaming in Power BI. |
DatasetUser
A Power BI user access right entry for a dataset
Name | Type | Description |
---|---|---|
datasetUserAccessRight |
The access right that the user has for the dataset (permission level) |
|
displayName |
|
Display name of the principal |
emailAddress |
|
Email address of the user |
graphId |
|
Identifier of the principal in Microsoft Graph. Only available for admin APIs. |
identifier |
|
Identifier of the principal |
principalType |
The principal type |
|
profile |
A Power BI service principal profile. Only relevant for Power BI Embedded multi-tenancy solution. |
DatasetUserAccessRight
The access right that the user has for the dataset (permission level)
Name | Type | Description |
---|---|---|
None |
|
Removes permission to the content in the dataset |
Read |
|
Grants Read access to the content in the dataset |
ReadExplore |
|
Grants Read and Explore access to the content in the dataset |
ReadReshare |
|
Grants Read and Reshare access to the content in the dataset |
ReadReshareExplore |
|
Grants Read, Reshare, and Explore access to the content in the dataset |
ReadWrite |
|
Grants Read and Write access to the content in the dataset |
ReadWriteExplore |
|
Grants Read, Write, and Explore access to the content in the dataset |
ReadWriteReshare |
|
Grants Read, Write, and Reshare access to the content in the dataset |
ReadWriteReshareExplore |
|
Grants Read, Write, Reshare, and Explore access to the content in the dataset |
Datasource
A Power BI data source
Name | Type | Description |
---|---|---|
connectionDetails |
The data source connection details |
|
connectionString |
|
(Deprecated) The data source connection string. Available only for DirectQuery. |
datasourceId |
|
The bound data source ID, which is empty when not bound to a gateway |
datasourceType |
|
The data source type |
gatewayId |
|
The bound gateway ID, which is empty when not bound to a gateway. When using a gateway cluster, the gateway ID refers to the primary (first) gateway in the cluster and is similar to the gateway cluster ID. |
name |
|
(Deprecated) The data source name. Available only for DirectQuery. |
DatasourceConnectionDetails
The Power BI data source connection details. See examples in Get Datasources or Get Datasources In Group.
Name | Type | Description |
---|---|---|
account |
|
The connection account |
classInfo |
|
The connection class information |
database |
|
The connection database |
domain |
|
The connection domain |
emailAddress |
|
The connection email address |
kind |
|
The connection kind |
loginServer |
|
The connection login server |
path |
|
The connection path |
server |
|
The connection server |
url |
|
The connection URL |
DefaultRetentionPolicy
The default retention policy
Name | Type | Description |
---|---|---|
None |
|
None |
basicFIFO |
|
basicFIFO |
DependentDataflow
A Power BI dependent dataflow
Name | Type | Description |
---|---|---|
groupId |
|
The target group ID |
targetDataflowId |
|
The target dataflow ID |
Encryption
Encryption information for a dataset
Name | Type | Description |
---|---|---|
EncryptionStatus |
Dataset encryption status |
EncryptionStatus
Dataset encryption status
Name | Type | Description |
---|---|---|
InSyncWithWorkspace |
|
Encryption is supported and is in sync with the encryption settings |
NotInSyncWithWorkspace |
|
Encryption is supported but isn't in sync with the encryption settings |
NotSupported |
|
Encryption isn't supported for this dataset |
Unknown |
|
The encryption status is unknown due to dataset corruption |
Measure
A Power BI measure
Name | Type | Description |
---|---|---|
description |
|
Optional. The measure description. |
expression |
|
A valid DAX expression |
formatString |
|
Optional. A string describing how the value should be formatted when it's displayed as specified in FORMAT_STRING. |
isHidden |
|
Optional. Whether the measure is hidden. |
name |
|
The measure name |
PrincipalType
The principal type
Name | Type | Description |
---|---|---|
App |
|
Service principal type |
Group |
|
Group principal type |
None |
|
No principal type. Use for whole organization level access. |
User |
|
User principal type |
Relationship
A relationship between tables in a dataset
Name | Type | Default Value | Description |
---|---|---|---|
crossFilteringBehavior | OneDirection |
The filter direction of the relationship |
|
fromColumn |
|
The name of the foreign key column |
|
fromTable |
|
The name of the foreign key table |
|
name |
|
The relationship name and identifier |
|
toColumn |
|
The name of the primary key column |
|
toTable |
|
The name of the primary key table |
Row
A data row in a dataset
Name | Type | Description |
---|---|---|
id |
|
The unique row ID |
ServicePrincipalProfile
A Power BI service principal profile. Only relevant for Power BI Embedded multi-tenancy solution.
Name | Type | Description |
---|---|---|
displayName |
|
The service principal profile name |
id |
|
The service principal profile ID |
Table
A dataset table
Name | Type | Description |
---|---|---|
columns |
|
The column schema for this table |
description |
|
The table description |
isHidden |
|
Optional. Whether this dataset table is hidden. |
measures |
|
The measures within this table |
name |
|
The table name |
rows |
|
The data rows within this table |
source |
The table source |