Push Datasets - Datasets PostDatasetInGroup

Creates a new dataset in the specified workspace.

Note: This API supports only Push datasets.

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

POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets?defaultRetentionPolicy={defaultRetentionPolicy}

URI Parameters

Name In Required Type Description
groupId
path True
  • string
uuid

The workspace id

defaultRetentionPolicy
query

The default retention policy

Request Body

Name Required Type Description
datasources

The datasources associated with this dataset.

defaultMode

The dataset mode or type.

name True
  • string

The dataset name

relationships

The dataset relationships.

tables True

The dataset tables.

Responses

Name Type Description
201 Created

Created

202 Accepted

Accepted

Examples

Push example

Sample Request

POST https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/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

Column

A dataset column

CreateDatasetRequest

A Power BI dataset

CrossFilteringBehavior

The filter direction of the relationship

Dataset

A Power BI dataset

DatasetMode

The dataset mode or type.

Datasource

A Power BI datasource

DatasourceConnectionDetails

A Power BI datasource connection details

DefaultRetentionPolicy

The default retention policy

Encryption

Encryption information for a dataset

EncryptionStatus

Dataset encryption status

Measure

A Power BI measure

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

formatString
  • string

(Optional) The format of the column as specified in FORMAT_STRING

name
  • string

The column name

CreateDatasetRequest

A Power BI dataset

Name Type Description
datasources

The datasources associated with this dataset.

defaultMode

The dataset mode or type.

name
  • string

The dataset name

relationships

The dataset relationships.

tables

The dataset tables.

CrossFilteringBehavior

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
ContentProviderType
  • string

The content provider type for the dataset

CreateReportEmbedURL
  • string

The dataset create report embed url

CreatedDate
  • string

DateTime of creation of this dataset

Encryption

The dataset encryption information (Only applicable when $expand is specified)

IsEffectiveIdentityRequired
  • boolean

Whether the dataset requires an effective identity. This indicates that you must send an effective identity using the GenerateToken API.

IsEffectiveIdentityRolesRequired
  • boolean

Whether RLS is defined inside the PBIX file. This indicates that you must specify a role.

IsOnPremGatewayRequired
  • boolean

Dataset requires an On-premises Data Gateway

IsRefreshable
  • boolean

Can this dataset be refreshed

QnaEmbedURL
  • string

The dataset qna embed url

addRowsAPIEnabled
  • boolean

Whether the dataset allows adding new rows

configuredBy
  • string

The dataset owner

id
  • string

The dataset id

name
  • string

The dataset name

webUrl
  • string

The dataset web url

DatasetMode

The dataset mode or type.

Name Type Description
AsAzure
  • string

A dataset with a live connection to Azure Analysis Service

AsOnPrem
  • string

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

Push
  • string

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

PushStreaming
  • string

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

Streaming
  • string

A dataset which supports data streaming, learn more

Datasource

A Power BI datasource

Name Type Description
connectionDetails

The datasource connection details

connectionString
  • string

(Deprecated) 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

(Deprecated) 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

DefaultRetentionPolicy

The default retention policy

Name Type Description
None
  • string

None

basicFIFO
  • string

basicFIFO

Encryption

Encryption information for a dataset

Name Type Description
EncryptionStatus

Dataset encryption status

EncryptionStatus

Dataset encryption status

Name Type Description
InSyncWithWorkspace
  • string

Encryption is supported and is in sync with the encryption settings

NotInSyncWithWorkspace
  • string

Encryption is supported and not in sync with the encryption settings

NotSupported
  • string

Encryption is not supported for this dataset

Unknown
  • string

Unable to determine state due to dataset corruption

Measure

A Power BI measure

Name Type Description
expression
  • string

A valid DAX expression

name
  • string

The measure name

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