You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

(Draft in Progress)

Microsoft Power BI is a business analytics platform that provides interactive data visualizations for business intelligence (BI). You can use Microsoft Power BI to build customized reports or combine the data it provides with data from other tools to build a unified dashboard.

You can use the License Statistics API as input to Power BI; for example, to create a custom report.

  1. Create a token with API scope 
  2. Add a Web data source to Power BI
  3. Prepare data
  4. Create a report

Create a token with API scope

Save the new API token. It will appear in the API Tokens grid.


Add a Web Data Source to Power BI

In the Power BI Desktop, create a new report and add a Web data source from the Get Data menu.

Complete the form that displays. Use the Advanced option to add API endpoints. For our example, we’ll use the "/api/v2/feature/{id}/usage-history/json" endpoint. 

The Feature ID (set to 60 in our example) can be taken using the "/api/v2/feature/list" endpoint, but also can be taken from the License Statistics UI by displaying the Feature ID column (hidden by default) on any grid.

Set the query parameters; for example, you might set a start date of December 6, 2022, and an end date of December 11, 2022:

  1. sd=2022-12-06
  2. ed=2022-12-11
  3. granularity=DAY

For a complete list of optional API endpoint parameters see API endpoints.

Add the appropriate HTTP request headers:

  1. Accept: */*
  2. X-Auth-token: {API token value} 


When asked, use the Anonymous access option. Authorization has already been handled by the token added to the header in the previous step.

Click Connect to access the defined Web source and get the requested data.

Prepare the data

The data that Power BI receives from the License Statistics API must be formatted before you can read it. 

Click List to navigate to the data key details.  

Convert the list of records to a table using the "To Table" option.

The results appear as shown below.

The resulting Table of records can be expanded to include multiple columns. Select the fields from the response that are needed for your desired report. For our example, we'll choose the following fields:

  1. lud (date)
  2. lumin (min used)
  3. lumax (max used)
  4. ft (total)

Note: You can also set a list of returned columns using the fieldsVisibility request parameter.

The table will be expanded to a multi-column view.

Note: See API endpoints for a full list of parameters along with descriptions.

For proper processing, define the type of data for each column. In our example, the lud property is a Date type, while the rest of the properties are Whole Numbers.

Rename the columns so they will be understandable in the reports.

Create a Report

Once you have prepared the data source, you can use the data to create your custom report; for example, you could create a Usage History report for a particular feature presenting minimum, maximum usage, and total number of licenses used daily during a selected period of time. 

For our example, we created a line chart with a date on the X Axis, and on the Y Axis, the values from the three data series: Max Used, Min Used, and Total.


  • No labels