แก้ไข

แชร์ผ่าน


Create an active bugs report in Power BI based on a custom Analytics view

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Analytics views support creating status and trend reports for work items based on teams or field criteria of your choosing. This article provides a tutorial for creating a custom Analytics view, loading it into Power BI, and then creating a stacked area trend report similar to the following image.

Screenshot of Active Bug trends stacked area chart report.

In this article, you learn how to:

  • Create a custom Analytics view for active bugs
  • Generate a Power BI report based on that view
  • Create a trend chart

For an overview of Analytics views, see About Analytics views.

Prerequisites

Power BI prerequisites

Open Analytics to access views

From your web portal, select Boards > Analytics views.

If you don't see Analytics views, check that you have permissions to view Analytics. See the Permissions and prerequisites to access Analytics.

Screenshot of expanding the Boards hub and choosing Analytics views, which is surrounded by red square.

Create your custom view

From the web portal, Analytics view, choose plus icon New View to create a custom view. Fill out the forms provided in each tab as shown in the following steps.

Choose Save to move to the next tab in the panel. If you need to revisit a tab, select the tab title.

Name your view

  1. Give your view a name, such as Active Bugs. Select Private view to save it under My Views. Only you have access to views saved under My Views. Otherwise, you can select Shared view to save it under Shared Views.

    Screenshot of Manage Active Bugs dialog, General tab.

    Choose Save to move to the next tab.

  2. From the Work items tab, select the top-level filter for the work items.

    • Choose Filter by team to select work items defined for one or more projects and teams.
    • Choose Filter by area path to select work items defined for one or more projects and area paths.

    Here we choose the Fabrikam Fiber project and the Production area path.

    Screenshot of Manage Active Bugs dialog, Work Items tab.

    To add more projects or teams, select Add to add a new row, and then select the project and team.

  3. Under Backlogs and work items, select Add, and then select Bug from the list of work items types.

    Filter by "bug"

  4. Under Field criteria, make the following selections to filter work items to only active bugs. Note, the bug states for your project may differ from those states used in this example.

    • Select Add, select State, choose , and then choose Closed .
    • Select Add, select State, choose , and then choose Removed .

    filter active bugs

    Choose Save to move to the next tab.

  5. In the next tab, Fields, keep the set of fields automatically selected. Add any custom fields you may want to report on.

    Screenshot of Manage Active Bugs dialog, Fields tab.

    Choose Save to move to the next tab.

  6. In the History tab, select Rolling period in days and enter the number of days of interest. Here we enter 90 days. For Granularity, choose Weekly. (For smaller or larger time periods, consider choosing Daily or Monthly, respectively.

    60 days of history with Daily granularity

    These selections generate a snapshot for each bug and for each week the bug is in a new, proposed, active, or resolved state. For more information about these defining trend data options, see Create an Analytics view, History.

    Choose Save to move to the next tab.

  7. On the last tab, Verification, select Verify view. Azure DevOps verifies your view by running a test query against the dataset to your filter criteria.

    Verify the view

    Note

    Verification time will vary based on the amount of data defined in your view. Verify your view to make sure all the definitions are correct.

    Once your view successfully verifies, choose Save. You can then start using it in Power BI. Verification also returns an estimate of the number of rows in the dataset.

    successful verification

    If your view fails to verify successfully, you get an error explaining the issue and pointing to a possible fix. Try changing the options you selected in the Work Items and History tabs to include less data, and then verify the view again.

Open Power BI desktop and load your view

  1. Open Power BI Desktop.
  1. Choose (1) Get Data and select More..., (2) Online Services, (3) Azure DevOps (Boards only), and then (4) Connect.

    Screenshot of Power BI, Connect to Azure DevOps (Boards only).

  2. Enter your organization name, the same Azure DevOps name you used to create the Active Bugs view, and the same project for which you defined the Active Bugs view.

    Dialog to enter Azure DevOps Organization and project name.

  1. Choose (1) Get Data and select More..., (2) Online Services, (3) Azure DevOps Server (Boards only), and then (4) Connect.

    Screenshot of Power BI, Connect to Azure DevOps Server (Boards only).

  2. Enter the URL for your server and collection, the same project for which you defined the Active Bugs view.

    Screenshot of Power BI, Dialog to enter Azure DevOps Project Collection and project name.

  1. Expand the folders as needed, and choose the Active Bugs view you saved in the previous section, and then select Load.

    Screenshot of Power BI, Dialog of Navigator to choose Analytics view.

Need help with connecting? See Connect with Power BI Data Connector.

Close the query and apply your changes

Once you've completed all your data transformations, choose Close & Apply from the Home menu to save the query and return to the Report tab in Power BI.

Screenshot of Power Query Editor Close and Apply option.

Create a stacked area chart report

  1. In Power BI, choose the Report view.

    Screenshot of Power BI Report view selection.

  2. Under Visualizations, choose Stacked area chart report.

    Screenshot of Power BI Visualizations and Fields selections for Active Bugs Stacked area chart report.

    • Add Date" to X-axis, and right-click Date and select Date rather than Date Hierarchy.

    • Add State to Y-axis, and right-click Count.

    • Add State to Legend.

  3. The example report displays.

    Screenshot of Sample Active Bug trends stacked area chart.

Tip

If you need to modify your Analytics view, you can do so and then return to your Power BI report and refresh the data. Simply select the Refresh option as shown.

Screenshot of Power BI, Refresh report data.

Save and publish your report

  1. Choose File > Save As to save your report to your local workspace.

  2. To publish your report to Power BI, choose the Publish tab. For more information, see Collaborate in your Power BI app workspace.

    Choose the Publish tab.

Continue to explore your data

Analytics views provide you with a great deal of power and flexibility to filter your data and generate useful reports quickly and easily using Power BI. Within a custom view, you can create datasets that span multiple teams or projects.