Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Markzolotoy
Impactful Individual
Impactful Individual

Getting data using odata query

I am following this link:

Feature Progress rollup sample Power BI report - Azure DevOps | Microsoft Docs

The exampe query is this:

let Source = OData.Feed ("https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/WorkItems?" &"$filter=WorkItemType eq 'Feature' " &"and State ne 'Cut' " &"and startswith(Area/AreaPath,'{areapath}') " &"and Descendants/any()" &"&$select=WorkItemId,Title,Area,Iteration,AssignedTo,WorkItemType,State,AreaSK" &"&$expand=Descendants( " &"$apply=filter(WorkItemType eq 'User Story') " &"/groupby((StateCategory), " &"aggregate(StoryPoints with sum as TotalStoryPoints)) " &") " ,null, [Implementation="2.0",OmitValues = ODataOmitValues.Nulls,ODataVersion = 4]) in Source

 

Is it possible to add hours being spent on tasks/stories?

 

I got a sample code in my VS Code. NO matter what I do I only get this when I run it:

{"@odata.context":"https://analytics.dev.azure.com/My company name/my project name/_odata/v3.0-preview/$metadata#WorkItems(WorkItemId,Title,WorkItemType,State,CreatedDate)","value":[]}

No erros, nothing.
1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Markzolotoy ,

According to the official article description,Check the Prerequisites first:

Prerequisites

  • You must be a member of a project with Basic access or higher. If you haven't been added as a project member, get added now. Anyone with access to the project, except stakeholders, can view Analytics views.
  • For Analytics data to be available, the corresponding service must be enabled. For example, to query work tracking data, Boards must be enabled. If it is disabled, Analytics views won't be displayed. To re-enable a service, see Turn an Azure DevOps service on or off
  • To use Analytics views, enable the Analytics Views preview feature either for individual users or for the organization.
  • Also, you must have your *View Analytics permission set to Allow. For more information, see Grant permissions to access the Analytics service.
  • To use Power BI for Azure DevOps or to exercise an OData query for Analytics, you must must have your View Analytics permission set to Allow. By default, all Contributors with Basic access are granted access. To edit shared Analytics views, you must have your *Edit shared Analytics views permission set to Allow. For more information, see Grant permissions to access the Analytics service.

And the OData query result set is in JSON format. To view the results, install the JSON Formatter extension for your browser. Several options are available for both Chrome and Microsoft Edge.

vluwangmsft_2-1637200637313.png

If the query has an error, the Analytics service returns an error in JSON format. For example, this error states that the query has selected a field that doesn't exist:

 

vluwangmsft_3-1637200658205.png

 

After you've verified that the query works correctly, you can run it from Power BI.

And you could try as the upper picture ,try to input   part values for   the columns ,and test  what will output?

And you said ,is it possible to add hours being spent on tasks/stories?

What you mean,add a new column to record  the time   each task spended?

 

And you could test step by step as the below aritcle:

Connect with data by using Power BI and OData queries

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

1 REPLY 1
v-luwang-msft
Community Support
Community Support

Hi @Markzolotoy ,

According to the official article description,Check the Prerequisites first:

Prerequisites

  • You must be a member of a project with Basic access or higher. If you haven't been added as a project member, get added now. Anyone with access to the project, except stakeholders, can view Analytics views.
  • For Analytics data to be available, the corresponding service must be enabled. For example, to query work tracking data, Boards must be enabled. If it is disabled, Analytics views won't be displayed. To re-enable a service, see Turn an Azure DevOps service on or off
  • To use Analytics views, enable the Analytics Views preview feature either for individual users or for the organization.
  • Also, you must have your *View Analytics permission set to Allow. For more information, see Grant permissions to access the Analytics service.
  • To use Power BI for Azure DevOps or to exercise an OData query for Analytics, you must must have your View Analytics permission set to Allow. By default, all Contributors with Basic access are granted access. To edit shared Analytics views, you must have your *Edit shared Analytics views permission set to Allow. For more information, see Grant permissions to access the Analytics service.

And the OData query result set is in JSON format. To view the results, install the JSON Formatter extension for your browser. Several options are available for both Chrome and Microsoft Edge.

vluwangmsft_2-1637200637313.png

If the query has an error, the Analytics service returns an error in JSON format. For example, this error states that the query has selected a field that doesn't exist:

 

vluwangmsft_3-1637200658205.png

 

After you've verified that the query works correctly, you can run it from Power BI.

And you could try as the upper picture ,try to input   part values for   the columns ,and test  what will output?

And you said ,is it possible to add hours being spent on tasks/stories?

What you mean,add a new column to record  the time   each task spended?

 

And you could test step by step as the below aritcle:

Connect with data by using Power BI and OData queries

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.