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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
PPNewbie
New Member

DataFormat.Error: We expected a property 'servicePlans', but the OData service omitted it from the r

I have this code in query powerbi desktop:

let
resource="https://graph.microsoft.com",
tokenResponse = Json.Document(Web.Contents("https://login.windows.net/",
[
RelativePath = #"Azure AD Tenant ID" & "/oauth2/token",
Content = Text.ToBinary(Uri.BuildQueryString(
[
client_id = #"Azure Application Client ID",
resource = resource,
grant_type = "client_credentials",
client_secret = #"Azure Application Client Secret"
]
)),
Headers = [Accept = "application/json"], ManualStatusHandling = {400}
])),
access_token = tokenResponse[access_token],
Source = OData.Feed("https://graph.microsoft.com/beta/users?$top=120&$select=id, prepaidUnits, servicePlans, deletedDateTime, accountEnabled, AgeGroup, assignedLicenses, assignedPlans, businessPhones, city, companyName, consentProvidedForMinor, country, createdDateTime, creationType, department, deviceKeys, displayName, employeeHireDate, employeeId, employeeOrgData, employeeType, externalUserState, externalUserStateChangeDateTime, faxNumber, givenName, identities, imAddresses, infoCatalogs, isResourceAccount, jobTitle, lastPasswordChangeDateTime, legalAgeGroupClassification, licenseAssignmentStates, mail, mailNickname, mobilePhone, officeLocation, onPremisesDistinguishedName, onPremisesDomainName, onPremisesExtensionAttributes, onPremisesImmutableId, onPremisesLastSyncDateTime, onPremisesProvisioningErrors, onPremisesSamAccountName, onPremisesSecurityIdentifier, onPremisesSyncEnabled, onPremisesUserPrincipalName, otherMails, passwordPolicies, passwordProfile, postalcode, preferredDataLocation, preferredLanguage, provisionedPlans, proxyAddresses, refreshTokensValidFromDateTime, showInAddressList, signInSessionsValidFromDateTime, state, streetAddress, surname, usageLocation, userPrincipalName, userType", [ Authorization = "Bearer " & access_token ], [ ExcludedFromCacheKey = {"Authorization"}, ODataVersion = 4, Implementation = "2.0" ]),
#"Expanded prepaidUnits" = Table.ExpandRecordColumn(Source, "prepaidUnits", {"enabled", "suspended", "warning"}, {"prepaidUnits.enabled", "prepaidUnits.suspended", "prepaidUnits.warning"}),
#"Expanded servicePlans" = Table.ExpandListColumn(#"Expanded prepaidUnits", "servicePlans"),
#"Expanded servicePlans1" = Table.ExpandRecordColumn(#"Expanded servicePlans", "servicePlans", {"servicePlanId", "servicePlanName", "provisioningStatus", "appliesTo"}, {"servicePlans.servicePlanId", "servicePlans.servicePlanName", "servicePlans.provisioningStatus", "servicePlans.appliesTo"})
in

#"Expanded servicePlans1"

 

 

and I got this error occur:

DataFormat.Error: We expected a property 'servicePlans', but the OData service omitted it from the response data. This can occur for a number of reasons and does not necessarily imply that the data does not exist or is of a default value.
Details:
Property=servicePlans

Any ideas how to fix this? Please help me, thank you.

2 REPLIES 2
ronan
Frequent Visitor

@jennratten I reached this post because I have the same error, but in v1.0 version API.

When I make the request with manager expanded, ie:

my_url = "https://graph.microsoft.com/v1.0/users?$select=id,userPrincipalName&$expand=manager($levels=1;$selec...)",

graphData = OData.Feed(my_url, [ Authorization = "Bearer " & access_token ], [ ExcludedFromCacheKey = {"Authorization"}, ODataVersion = 4, Implementation = "2.0" ])

 

all users that doesn't have managers would come blank, but I got errors:

ronan_0-1733506720090.png

 

how could I solve or override this error?

jennratten
Super User
Super User

Hello @PPNewbie - It looks like you could be having problems for a few different reasons - the API endpoint is beta (usability is not always reliable), the application may not have the right permission to view that property.  Does the source step throw the error or is the error only present after one of the later steps?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors