Power BI Embedded libraries for .NET

Power BI is a cloud-based business analytics service that gives you a single view of your most critical business data.

To learn more about using Power BI with .NET, see Embedding with Power BI.

Client library

Use the client library to connect with Power BI APIs to access and interact with data sets and reports.

Install the NuGet package directly from the Visual Studio Package Manager console.

Visual Studio Package Manager

Install-Package Microsoft.PowerBI.Api


The following example retrieves and displays a list of datasets and reports.

/* Include these'using' directive:
using Microsoft.PowerBI.Api.V2;
using Microsoft.PowerBI.Api.V2.Models;
using (PowerBIClient client = new PowerBIClient(new Uri(apiUrl), tokenCredentials))

    Console.WriteLine("\r*** DATASETS ***\r");

    // List of datasets in a group/app workspace
    ODataResponseListDataset datasetList = client.Datasets.GetDatasetsInGroup(groupId);

    foreach(Dataset ds in datasetList.Value)
        Console.WriteLine(ds.Id + " | " + ds.Name);

    Console.WriteLine("\r*** REPORTS ***\r");

    // List of reports in a group/app workspace
    ODataResponseListReport reportList = client.Reports.GetReportsInGroup(groupId);

    foreach (Report rpt in reportList.Value)
        Console.WriteLine(rpt.Id + " | " + rpt.Name +  " | DatasetID = " + rpt.DatasetId);


Explore more sample .NET code you can use in your apps.