Power BI Desktop Samples

repository·main·Indexed 24 days ago

https://github.com/microsoft/powerbi-desktop-samples

A collection of Power BI Desktop sample files (.pbix), including monthly blog updates, general report samples, and the Adventure Works DW 2020 DAX sample model (v1.4). The repository provides authoritative JSON schemas for validating report themes, dataset items, and common Power BI item metadata (such as .pbip, item.config.json, and item.metadata.json), with instructions for integrating these schemas into Visual Studio Code for Intellisense and validation.

Tokens
6.4K
Snippets
4
Records
40
Agent score
82%

What's inside powerbi-desktop-samples

  1. Overview of Power BI Item Schemas

    main

    The item-schemas directory contains authoritative JSON schema files used for validating Power BI item metadata. These schemas are categorized into three main groups:

    • Report schemas: Located in ./report/, these validate Report metadata files.
    • Dataset schemas: Located in ./dataset/, these validate Dataset metadata files.
    • Common schemas: Located in ./common/, these validate metadata files that are common to all Power BI items (such as .pbip files, item.config.json, and item.metadata.json).
  2. Validate dataset item metadata files using JSON schemas

    main
    The item-schemas/dataset/ directory contains the authoritative JSON schema files used to validate the metadata files associated with Power BI dataset items. These schemas ensure that files like .pbi settings, .pbidataset definitions, and item.config.json conform to the expected structure required by Power BI Desktop.
  3. Validate common Power BI item metadata files using JSON schemas

    main

    This repository provides authoritative JSON schema files used to validate the structure and content of common Power BI item metadata files. Use these schemas to ensure that configuration, metadata, and project files conform to the expected format for Power BI Desktop samples and related tooling.

    The available schemas cover:

    • item.config.json: Configuration settings for items.
    • item.metadata.json: Metadata definitions for items.
    • .pbip: Power BI Project file structure.
  4. Explore Monthly Blog and Report samples

    main

    This repository contains two main collections of Power BI files for learning and exploration:

    • Monthly Blog Samples: Located in the Monthly Desktop Blog Samples folder, these are the .pbix files used in monthly Power BI blog posts and video updates.
    • Report Samples: Located in the Sample Reports folder, these contain various report templates designed to help you explore different Power BI capabilities.
  5. Analyze Power BI report performance with Performance Analyzer

    main
    Use the Performance Analyzer in Power BI Desktop to measure the performance of report elements like visuals and DAX formulas. It allows you to record logs that track how elements perform during user interaction and identify resource-intensive components. You can export these performance logs to a JSON format for deeper analysis.
  6. Structure of a Power BI Report item metadata set

    main

    A Power BI report item (represented as <report name>.Report) consists of several key metadata and configuration files. Use the following file structure as a reference for valid report item metadata:

    • .pbi/localSettings.json: Contains local settings for the report.
    • definition.pbir: The primary definition file for the report.
    • item.config.json: Configuration metadata for the item.
    • item.metadata.json: Metadata describing the item properties.
  7. Limitations of the Report Theme JSON Schema

    main

    The custom report theme JSON currently has the following unsupported features:

    • Dynamic Content References: You cannot reference dynamic content that reports support, with the exception of ThemeDataColor expressions (e.g., expr: { SparklineData: { ... } } is not supported).
    • Model-Specific Items: You cannot reference items that depend on specific model data or fields, such as conditional formatting based on data values.
  8. Use Report Theme JSON schemas for validation

    main

    The repository provides JSON schemas located in the Report Theme JSON Schema folder. These schemas define the valid properties available for customizing Power BI report themes.

    You can use these schemas in two ways:

    1. External Development: Use them as a reference in your own application development tools to validate theme files.
    2. Direct Validation: Reference the schema directly within your custom theme JSON files using the "$schema" key to enable real-time validation in editors that support JSON schema.

    For detailed information, refer to the README.md file within the Report Theme JSON Schema folder.

  9. Structure of the ReportDefinition (definition.pbir)

    main

    The definition.pbir file is a required file that stores the ReportDefinition. It contains metadata about the overall file structure, core settings, and a reference to the dataset used by the report. The schema for this object does not accept additional properties.

    Required Properties

    • version: The version of the report artifact file format. Currently, the only valid value is "1.0".
    • datasetReference: A reference to the bound dataset, defined using either byPath or byConnection.
  10. Use Report Theme schemas for ISV application development

    main

    Independent Software Vendors (ISVs) building applications that interact with Power BI themes can use these Draft-7 compliant schemas to:

    • Programmatically generate custom theme JSON files.
    • Identify and document all available formatting options for clients.
    • Validate theme files before they are passed to Power BI Desktop.

    Note: Power BI Desktop uses the Ajv library for its internal validation. If your application uses a different validator, error messages may differ from those seen in Power BI Desktop.