{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/power-bi/json-schema/power-bi-create-dataset-request-schema.json",
  "title": "CreateDatasetRequest",
  "description": "Request body for creating a push dataset",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/power-bi-datasets-api-openapi.yml#/components/schemas/CreateDatasetRequest",
  "type": "object",
  "required": [
    "name",
    "tables"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "The display name of the dataset"
    },
    "defaultMode": {
      "type": "string",
      "description": "The dataset mode",
      "enum": [
        "Push",
        "Streaming",
        "PushStreaming"
      ]
    },
    "tables": {
      "type": "array",
      "description": "The tables within the dataset",
      "items": {
        "$ref": "#/$defs/Table"
      }
    },
    "relationships": {
      "type": "array",
      "description": "Relationships between tables",
      "items": {
        "$ref": "#/$defs/Relationship"
      }
    }
  },
  "$defs": {
    "Column": {
      "type": "object",
      "required": [
        "name",
        "dataType"
      ],
      "description": "A column in a dataset table",
      "properties": {
        "name": {
          "type": "string",
          "description": "The column name"
        },
        "dataType": {
          "type": "string",
          "description": "The data type of the column",
          "enum": [
            "Int64",
            "Double",
            "Boolean",
            "Datetime",
            "String",
            "Decimal"
          ]
        },
        "formatString": {
          "type": "string",
          "description": "Optional format string for the column"
        },
        "sortByColumn": {
          "type": "string",
          "description": "Name of the column to sort by"
        },
        "isHidden": {
          "type": "boolean",
          "description": "Whether the column is hidden in reports"
        }
      }
    },
    "Measure": {
      "type": "object",
      "required": [
        "name",
        "expression"
      ],
      "description": "A DAX measure defined on a table",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the measure"
        },
        "expression": {
          "type": "string",
          "description": "The DAX expression for the measure"
        },
        "formatString": {
          "type": "string",
          "description": "Optional format string"
        },
        "isHidden": {
          "type": "boolean",
          "description": "Whether the measure is hidden in reports"
        }
      }
    },
    "Relationship": {
      "type": "object",
      "required": [
        "name",
        "fromTable",
        "fromColumn",
        "toTable",
        "toColumn"
      ],
      "description": "A relationship between two tables in a dataset",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the relationship"
        },
        "fromTable": {
          "type": "string",
          "description": "The source table name"
        },
        "fromColumn": {
          "type": "string",
          "description": "The source column name"
        },
        "toTable": {
          "type": "string",
          "description": "The target table name"
        },
        "toColumn": {
          "type": "string",
          "description": "The target column name"
        },
        "crossFilteringBehavior": {
          "type": "string",
          "description": "The cross-filtering direction",
          "enum": [
            "OneDirection",
            "BothDirections",
            "Automatic"
          ]
        }
      }
    },
    "Table": {
      "type": "object",
      "required": [
        "name",
        "columns"
      ],
      "description": "A table within a Power BI dataset",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the table"
        },
        "columns": {
          "type": "array",
          "description": "The columns in the table",
          "items": {
            "$ref": "#/$defs/Column"
          }
        },
        "rows": {
          "type": "array",
          "description": "Rows of data in the table",
          "items": {
            "type": "object"
          }
        },
        "measures": {
          "type": "array",
          "description": "DAX measures defined on the table",
          "items": {
            "$ref": "#/$defs/Measure"
          }
        }
      }
    }
  }
}