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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.