The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi, I'm importing the data through an API when I click on refresh it thorws an error stating "Cannot convert value null to type List"
please help I've attached pbix and screenshots below.
This is M code I'm using rn:
let
Source = List.Generate( ()=> [Result= try PageData(1) otherwise null, PageNumber = 1], each List.Count([Result]) >1, each [Result= try PageData([PageNumber]) otherwise null, PageNumber = [PageNumber] +1], each [Result]),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandListColumn(#"Converted to Table", "Column1"),
#"Expanded Column2" = Table.ExpandRecordColumn(#"Expanded Column1", "Column1", {"id", "summary", "recordType", "board", "status", "company", "site", "siteName", "addressLine1", "city", "stateIdentifier", "zip", "country", "contact", "contactName", "contactPhoneNumber", "contactEmailAddress", "type", "team", "owner", "priority", "serviceLocation", "source", "severity", "impact", "allowAllClientsPortalView", "customerUpdatedFlag", "automaticEmailContactFlag", "automaticEmailResourceFlag", "automaticEmailCcFlag", "closedDate", "closedBy", "closedFlag", "actualHours", "approved", "estimatedExpenseCost", "estimatedExpenseRevenue", "estimatedProductCost", "estimatedProductRevenue", "estimatedTimeCost", "estimatedTimeRevenue", "billingMethod", "subBillingMethod", "dateResolved", "dateResplan", "dateResponded", "resolveMinutes", "resPlanMinutes", "respondMinutes", "isInSla", "resources", "hasChildTicket", "hasMergedChildTicketFlag", "billTime", "billExpenses", "billProducts", "location", "department", "mobileGuid", "sla", "currency", "_info", "customFields", "agreement", "contactPhoneExtension", "automaticEmailCc", "subType", "item", "opportunity", "poNumber", "budgetHours", "parentTicketId", "mergedParentTicket", "addressLine2", "billingAmount", "knowledgeBaseLinkId", "knowledgeBaseLinkType"}, {"id", "summary", "recordType", "board", "status", "company", "site", "siteName", "addressLine1", "city", "stateIdentifier", "zip", "country", "contact", "contactName", "contactPhoneNumber", "contactEmailAddress", "type", "team", "owner", "priority", "serviceLocation", "source", "severity", "impact", "allowAllClientsPortalView", "customerUpdatedFlag", "automaticEmailContactFlag", "automaticEmailResourceFlag", "automaticEmailCcFlag", "closedDate", "closedBy", "closedFlag", "actualHours", "approved", "estimatedExpenseCost", "estimatedExpenseRevenue", "estimatedProductCost", "estimatedProductRevenue", "estimatedTimeCost", "estimatedTimeRevenue", "billingMethod", "subBillingMethod", "dateResolved", "dateResplan", "dateResponded", "resolveMinutes", "resPlanMinutes", "respondMinutes", "isInSla", "resources", "hasChildTicket", "hasMergedChildTicketFlag", "billTime", "billExpenses", "billProducts", "location", "department", "mobileGuid", "sla", "currency", "_info", "customFields", "agreement", "contactPhoneExtension", "automaticEmailCc", "subType", "item", "opportunity", "poNumber", "budgetHours", "parentTicketId", "mergedParentTicket", "addressLine2", "billingAmount", "knowledgeBaseLinkId", "knowledgeBaseLinkType"}),
#"Changed Type with Locale" = Table.TransformColumnTypes(#"Expanded Column2", {{"closedDate", type datetime}}, "en-US"),
#"Changed Type" = Table.TransformColumnTypes(#"Changed Type with Locale",{{"actualHours", type number}, {"closedDate", type date}})
in
#"Changed Type"
Pbix link :
https://drive.google.com/file/d/1qvuvLt3VPm6eU3103qWil47LJZivZZu0/view?usp=sharing
I can't open your pbix.
You can check the column with the error to see if there is a null value in it, if there is a null value, replace it with Replace Values.
Transform -- Replace Values.
This is a link to related content, hope it will help you:
https://community.powerbi.com/t5/Desktop/Cannot-convert-value-null-to-type-List/m-p/893014
https://community.powerbi.com/t5/Power-Query/Cannot-convert-to-type-List/m-p/1971275
Best Regards,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@V-pazhen-msft thank you for responding.
Can you open the pbix I can't perform replace values it is giving me the error at the source when I'm trying to get the data through API.
You can open the pbix -> Transform->Edit credentials-> anomymous
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
80 | |
66 | |
53 | |
52 |
User | Count |
---|---|
121 | |
118 | |
77 | |
64 | |
63 |