Microsoft Defender for Endpoint
Endpoint protection

Create Power BI reports with Microsoft Defender for Endpoint APIs

In brief

The article was retitled and its instructions now explain how to connect Power BI to the Advanced Hunting API and OData API, including what each example query retrieves.

What Defender admins need to know

Administrators get clearer guidance for building Power BI reports from Defender for Endpoint query results; no action is required.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Create custom reports using Power BI

[!INCLUDE Improve request performance]

In this section, you learn to create aCreate Power BI reportreports on top of Defender for Endpoint APIs.

The first example demonstrates how to connect Power BI to Advanced Hunting API, and the second example demonstrates a connection to our OData APIs, such as Machine Actions or Alerts.

Connect Power BI to Advanced Hunting API

Perform the following steps to connect Power BI to the Advanced Hunting API and build a report from query results.

  1. Open Microsoft Power BI.

  2. Select Get Data > Blank Query.

    :::image type="content" source="../media/power-bi-open-advanced-editor.png" alt-text="The Advanced Editor menu item" lightbox="../media/power-bi-open-advanced-editor.png":::

  3. Copy the code snippet below and paste it in the editor:editor. This query uses the Advanced Hunting API to retrieve up to 20 DeviceEvents entries where the action type contains "Anti", and maps the response schema to Power BI data types:

        let
    

Connect Power BI to OData APIs

The only difference frombetween the previousAdvanced Hunting API example and thisthe OData API example is the query inside the editor.

  1. Open Microsoft Power BI.

    :::image type="content" source="../media/power-bi-open-advanced-editor.png" alt-text="The Advanced Editor menu item" lightbox="../media/power-bi-open-advanced-editor.png":::

  2. Copy the following code, and paste it in the editoreditor. This query uses the OData API to pullretrieve all Machine Actions from your organization:organization, which you can use to build reports on response activities such as device isolation or antivirus scans:

        let