首页 > 解决方案 > Power BI - Expression.Error:我们无法将 null 值转换为 List 类型

问题描述

运行电源查询时出现此错误。有时它会成功刷新,有时它会给我这个错误。我该如何解决?它是我必须更改的数据类型吗?

Expression.Error:
We cannot convert the value null to type List.
Details:
    Value=
    Type=[Type]

这是引发错误的查询,有时它会刷新:

let

List = List.Generate(
    () => [i=0, x = ""],
    each [i] <= Count,
    each [
        i = [i] + 1,
        x =
        Table.FromRows(((Table.SelectRows(API, each [Index] = i)[Value]){0})[DataResult], { 

            "Date",                
            "Region",
            "Location",
            "Name",
            "VPN",
            "Category",
            "Network",   
            "Percentage",
            "BadQualityCount",
            "UnknownCount",
            "CallCount"
            
        })
    ]
),

Result = Table.FromRecords(List),
Result2 = Table.Skip(Result,1),
DataResultTable = Table.Combine(Result2[x]),
DataResultTableWithTypes = Table.TransformColumnTypes(DataResultTable,{            
  
            {"Date", Date.Type}, 
            {"Region", type text},
            {"Location", type text},
            {"Name", type text},
            {"VPN", type text},
            {"Category", type text},
            {"Network", type text},
            {"Percentage", type number},
            {"BadQualityCount", Int64.Type},
            {"UnknownCount", Int64.Type},
            {"CallCount", Int64.Type}

            }),

Output = Table.SelectRows(DataResultTableWithTypes, each true)

in
    Output

标签: powerbipowerquery

解决方案


推荐阅读