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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Simon_Newton
New Member

Single Query runs in power query but will not load into power bi m engine error

hi all,

 

i am getting this Mengine error; microsoft mashupengine [expression error] we cannot convert the value 599 to type list

 

here is my code its calling less the company code redacted.

let
BaseUrl = "https://api-uk.vfp.viewpoint.com/vfp/",
Endpoint = "api/v2/enterprises/123456789101112/users",
Token = Auth_4Projects_Token,

Options = [
RelativePath = Endpoint,
Headers = [
Authorization = "Bearer " & Token,
Accept = "application/json",
#"User-Agent" = "PowerBI"
],
Timeout = #duration(0,0,10,0)
],

Get = () => Web.Contents(BaseUrl, Options),

T1 = try Get(),
R1 = if T1[HasError] then null else T1[Value],

R2 = if R1 = null then Function.InvokeAfter( () => Web.Contents(BaseUrl, Options), #duration(0,0,3,0)) else R1,
R3 = if R2 = null then Function.InvokeAfter( () => Web.Contents(BaseUrl, Options), #duration(0,0,6,0)) else R2,

Raw = if R3 = null then error "API timed out after 3 attempts." else R3,

JsonResponse = Json.Document(Raw),

Result =
if Value.Is(JsonResponse, type list) then
Table.FromRecords(JsonResponse)
else
error "Unexpected JSON format.",

BufferedResult = Table.Buffer(Result)
in
BufferedResult

 

 

this runs in query and calls a small table of results - with headers email - name - orgid - profilid- type  with 8 rows below it.

v confused why this is hanging. thanks in advance!

 

 

help m

1 ACCEPTED SOLUTION
v-ssriganesh
Community Support
Community Support

Hi @Simon_Newton,
Thank you for posting your query in the Microsoft Fabric Community Forum.

Based on the details shared, this error occurs because the API response is not consistently returning a JSON list. In some cases, the API appears to return a different payload (for example, a numeric value such as 599, or an error/timeout response). When Power Query evaluates Json.Document(Raw), it expects a list of records, but instead receives a non-list value, which results in the error “We cannot convert the value 599 to type List.”

Although the query may work correctly in the preview, during refresh Power BI can execute the query multiple times. Under these conditions, the API may return throttling, timeout or error responses with a different JSON structure, which leads to the load failure.

To resolve this, we recommend updating the query to:

  • Validate the HTTP response status before parsing the content,
  • Handle both list-based and record-based JSON responses, and
  • Call Table.FromRecords only when the response is confirmed to be a list.

For your reference: https://learn.microsoft.com/en-us/powerquery-m/json-document


Best regards,
Ganesh Singamshetty.

View solution in original post

3 REPLIES 3
Simon_Newton
New Member

thanks Ganesh  i now also see the limits of the desktop app. 

regards

 

simon

v-ssriganesh
Community Support
Community Support

Hello @Simon_Newton,

We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.

Thank you.

 

v-ssriganesh
Community Support
Community Support

Hi @Simon_Newton,
Thank you for posting your query in the Microsoft Fabric Community Forum.

Based on the details shared, this error occurs because the API response is not consistently returning a JSON list. In some cases, the API appears to return a different payload (for example, a numeric value such as 599, or an error/timeout response). When Power Query evaluates Json.Document(Raw), it expects a list of records, but instead receives a non-list value, which results in the error “We cannot convert the value 599 to type List.”

Although the query may work correctly in the preview, during refresh Power BI can execute the query multiple times. Under these conditions, the API may return throttling, timeout or error responses with a different JSON structure, which leads to the load failure.

To resolve this, we recommend updating the query to:

  • Validate the HTTP response status before parsing the content,
  • Handle both list-based and record-based JSON responses, and
  • Call Table.FromRecords only when the response is confirmed to be a list.

For your reference: https://learn.microsoft.com/en-us/powerquery-m/json-document


Best regards,
Ganesh Singamshetty.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Top Solution Authors
Top Kudoed Authors