Push Datasets - Datasets PostDataset

Creates a new dataset on "My Workspace".

Required scope: Dataset.ReadWrite.All
To set the permissions scope, see Register an app.

POST https://api.powerbi.com/v1.0/myorg/datasets

Request Body

Name Required Type Description
IsEffectiveIdentityRequired
  • boolean

Dataset requires effective identity

IsEffectiveIdentityRolesRequired
  • boolean

Dataset requires roles

IsOnPremGatewayRequired
  • boolean

Dataset requires an On-premises Data Gateway

IsRefreshable
  • boolean

Can this dataset be refreshed

addRowsAPIEnabled
  • boolean

Whether dataset allows adding new rows

configuredBy
  • string

The dataset owner

datasources

The datasources associated with this dataset. Only relevant to the PostDataset API.

defaultMode

The dataset mode or type. Only relevant to the PostDataset API.

defaultRetentionPolicy
  • string

The dataset default data retention policy. Only relevant to the PostDataset API.

id
  • string

The dataset id

name True
  • string

The dataset name

relationships

The dataset relationships. Only relevant to the PostDataset API.

tables True

The dataset tables. Only relevant to the PostDataset API.

webUrl
  • string

The dataset web url

Responses

Name Type Description
201 Created

Created

202 Accepted

Accepted. The request was accepted and dataset creation is in progress.

Examples

Push example

Sample Request

POST https://api.powerbi.com/v1.0/myorg/datasets
{
  "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"
        }
      ]
    }
  ]
}

Sample Response

{
  "id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
  "name": "SalesMarketing",
  "defaultRetentionPolicy": "basicFIFO"
}

Definitions

Column

A dataset column

CrossFilteringBehaviorEnum

The filter direction of the relationship

Dataset

A Power BI dataset

DatasetMode

The dataset mode or type. Only relevant to the PostDataset API.

Datasource

A Power BI datasource

DatasourceConnectionDetails

A Power BI datasource connection details

Measure

A Power BI measure

Object
Relationship

A relationship between tables in a dataset

Row

A data row in a dataset

Table

A dataset table

Column

A dataset column

Name Type Description
dataType
  • string

The column data type

name
  • string

The column name

CrossFilteringBehaviorEnum

The filter direction of the relationship

Name Type Description
Automatic
  • string

Cross filtering behavior defined automatically

BothDirections
  • string

For filtering purposes, both tables are treated as if they're a single table

OneDirection
  • string

For filtering purposes, filter will be applied on the table where values are being aggregated

Dataset

A Power BI dataset

Name Type Description
IsEffectiveIdentityRequired
  • boolean

Dataset requires effective identity

IsEffectiveIdentityRolesRequired
  • boolean

Dataset requires roles

IsOnPremGatewayRequired
  • boolean

Dataset requires an On-premises Data Gateway

IsRefreshable
  • boolean

Can this dataset be refreshed

addRowsAPIEnabled
  • boolean

Whether dataset allows adding new rows

configuredBy
  • string

The dataset owner

datasources

The datasources associated with this dataset. Only relevant to the PostDataset API.

defaultMode

The dataset mode or type. Only relevant to the PostDataset API.

defaultRetentionPolicy
  • string

The dataset default data retention policy. Only relevant to the PostDataset API.

id
  • string

The dataset id

name
  • string

The dataset name

relationships

The dataset relationships. Only relevant to the PostDataset API.

tables

The dataset tables. Only relevant to the PostDataset API.

webUrl
  • string

The dataset web url

DatasetMode

The dataset mode or type. Only relevant to the PostDataset API.

Name Type Description
AsAzure
  • string

Creates a dataset with a live connection to Azure Analysis Service

AsOnPrem
  • string

Creates a dataset with a live connection to On-premise Analysis Service

Push
  • string

Creates a dataset which allows programmatic access for pushing data into PowerBI, learn more

PushStreaming
  • string

Creates a dataset which supports data streaming and allows programmatic access for pushing data into Power BI

Streaming
  • string

Creates a dataset which supports data streaming, learn more

Datasource

A Power BI datasource

Name Type Description
connectionDetails

The datasource connection details

connectionString
  • string

The datasource connection string. Available only for DirectQuery.

datasourceId
  • string

The bound datasource id. Empty when not bound to a gateway.

datasourceType
  • string

The datasource type

gatewayId
  • string

The bound gateway id. Empty when not bound to a gateway.

name
  • string

The datasource name. Available only for DirectQuery.

DatasourceConnectionDetails

A Power BI datasource connection details

Name Type Description
database
  • string

The connection database

server
  • string

The connection server

url
  • string

The connection url

Measure

A Power BI measure

Name Type Description
expression
  • string

A valid DAX expression

name
  • string

The measure name

Object

Relationship

A relationship between tables in a dataset

Name Type Description
crossFilteringBehavior

The filter direction of the relationship

fromColumn
  • string

The name of the foreign key column

fromTable
  • string

The name of the foreign key table

name
  • string

The relationship name and identifier

toColumn
  • string

The name of the primary key column

toTable
  • string

The name of the primary key table

Row

A data row in a dataset

Name Type Description
id
  • string

The unique row id

Table

A dataset table

Name Type Description
columns

The column schema for this table

measures

The measures within this table

name
  • string

The table name

rows

The data rows within this table