FabricTools.Items.Report 0.2.0

dotnet add package FabricTools.Items.Report --version 0.2.0
                    
NuGet\Install-Package FabricTools.Items.Report -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FabricTools.Items.Report" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FabricTools.Items.Report" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="FabricTools.Items.Report" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FabricTools.Items.Report --version 0.2.0
                    
#r "nuget: FabricTools.Items.Report, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FabricTools.Items.Report@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FabricTools.Items.Report&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=FabricTools.Items.Report&version=0.2.0
                    
Install as a Cake Tool

PBIR.NET

NuGet Version NuGet Downloads

.NET SDK for the Fabric PBIR Format

The Fabric PBIR Format, currently in public preview, is a new schema-based and source control friendly format for Power BI reports. It brings the same code-first benefits to Power BI report authors that the TMDL provides for Power BI semantic models. PBIR is also known as the "Power BI Enhanced Report Format" or simply the "V4 format".

Whilst the original ideas and prototypes for what now is the PBIR format were implemented by pbi-tools as a community-driven open-source initiative, the PBIR format is fully developed and supported by Microsoft. It effectively replaces black-box binary PBIX files which were ill-suited for source control and collaborative development.

This repository builds on top of Microsoft's publicly maintained json schemas for PBIR documents and metadata files. It provides a .NET SDK for working with PBIR files, including reading, writing, and validating the contents of these files.

A number of publicly available PBIR samples can be found here. A Power BI report in PBIR format can be identified via the version: "4.0" property in the definition.pbir file. Furthermore, it will have a definition/ sub-folder in the same directory, containing various json files, each of which with a $schema property pointing to the corresponding schema.

definition.pbir

{
  "version": "4.0",
  "datasetReference": {
    "byPath": {
      "path": "../AdventureWorks Sales.SemanticModel"
    }
  }
}

Using the SDK

The PBIR.NET SDK is available as a NuGet package. You can install it using the following command:

dotnet add package FabricTools.Items.Report

For convenience, import the base namespace:

using FabricTools.Items.Report;

The API entry point is the PbirDefinition class. It corresponds to the definition/ folder of a Fabric/Power BI Report item.

Use PbirDefinition.FromPath(string path) to load a PBIR definition from a file system folder. The path must point to the definition/ folder containing a report.json file.

var pbir = PbirDefinition.FromPath(definitionFolderPath);
pbir.Pages.Metadata.ActivePageName = "Page 3"; // sets the page a report opens with
foreach (var page in pbir.Pages) // iterate all report pages and inspect and/or modify settings
{
    var displayName = page.DisplayName;
    var numberOfVisuals = page.Visuals.Count;
}

pbir.Write(); // writes the modified PBIR definition, overwriting the original files

The resulting PbirDefinition object contains familiar properties like Pages, Bookmarks, etc. All properties can be read and modified. The SDK contains a strongly-typed API for all PBIR objects that is auto-generated from the JSON schemas.

PbirDefinition Intellisense

A modified PbirDefinition object can be saved back to the file system using PbirDefinition.Write(string path).

Schema Validation

The PbirValidator class can be used to validate a single PBIR file against its schema. Either a file system path can be provided, or an in-memory JObject.

var validator = new PbirValidator();
var errors = validator.Validate("./Report/definition/report.json");
if (errors.Count > 0)
{
	// handle reported validation errors
}

Status and Roadmap

The SDK is currently in preview and under active development. Further features will be prioritized based on community feedback. A comprehensive API documentation is planned for the near future.

Please report any issues or feature requests on the GitHub issue tracker.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 172 4/29/2025
0.1.0 165 4/22/2025