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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Rocky_Brown
Helper I
Helper I

M-Code

I have the following m-code to access DevOps server.  It is working, however, i get no data back in my table.  I am assuming is it due to the names of my columns in Dev Ops have spaces in the names.

Here is a listing of the column names:

Area Path, Assigned To, Iteration Path, Work Item ID, Work Item Type.

 

How do I code the below when I have spaces in the column names?

 

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,{Area Path})"
&" and Descendants/any()"
&"& $select=WorkItemId,Title,WorkItemType,State,AreaSK"
&"& $expand=AssignedTo($select=UserName),Iteration($select=IterationPath),Area($select=AreaPath),"
&"Descendants("
&"$apply=filter(WorkItemType eq 'User Story')"
&"/aggregate($count as CountOfUserStories, StoryPoints with sum as TotalStoryPoints)"
&")",
null, [Implementation="2.0",OmitValues = ODataOmitValues.Nulls,ODataVersion = 4]),
#"Expanded Descendants" = Table.ExpandTableColumn(Source, "Descendants", {"CountOfUserStories", "TotalStoryPoints"}, {"Descendants.CountOfUserStories", "Descendants.TotalStoryPoints"}),
#"Expanded Area" = Table.ExpandRecordColumn(#"Expanded Descendants", "Area", {"AreaPath"}, {"Area.AreaPath"}),
#"Expanded Iteration" = Table.ExpandRecordColumn(#"Expanded Area", "Iteration", {"IterationPath"}, {"Iteration.IterationPath"}),
#"Expanded AssignedTo" = Table.ExpandRecordColumn(#"Expanded Iteration", "AssignedTo", {"UserName"}, {"AssignedTo.UserName"})
in
#"Expanded AssignedTo"

 

Any help would be appreciated.

 

Thank you

3 REPLIES 3
amitchandak
Super User
Super User

@Rocky_Brown , column names can have space, But when they are used in steps, there also space should come

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I tried adjusting the code to something like this:

&"$filter=Work_x0020_Item_x0020_Type eq 'Feature'"

Using the _x0200_ as the space for the column name and get an error 

 

DataSource.Error: OData: Request failed: The remote server returned an error: (400) Bad Request. (VS403483: The query specified in the URI is not valid: VS403522: The property 'Work_x0020_Item_x0020_Type' is not available on the specified Project(s). Please remove 'Work_x0020_Item_x0020_Type' from your query and try again..)
Details:
DataSourceKind=OData
DataSourcePath=http://devops.janus.com/JanusIntl/All._ActiveWork/_odata/v3.0-preview/WorkItems
Url=http://devops.janus.com/JanusIntl/All._ActiveWork/_odata/v3.0-preview/WorkItems?$filter=Work_x0020_I... eq 'Feature' and State ne 'Cut' and startswith(Area/AreaPath,'ALL._ActiveWork') and Descendants/any()& $select=WorkItemId,Title,WorkItemType,State,AreaSK& $expand=AssignedTo($select=UserName),Iteration($select=IterationPath),Area($select=AreaPath),Descendants($apply=filter(WorkItemType eq 'User Story')/aggregate($count as CountOfUserStories, StoryPoints with sum as TotalStoryPoints))

 

Can you help me with how to adjust the code in order for me to return data?

 

Thank you

 

I tried coding with spaces and kept getting errors.  Looking for help to modify the code with spaces in my column names.

 

Thanks,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.