Forum Discussion

Lorenzo's avatar
Lorenzo
Silver Contributor
Apr 08, 2024
Solved

Power Query Table.Profile: The field 'NullCount' of the record wasn't found

With Microsoft Excel for Microsoft 365 MSO (Version 2403 Build 16.0.17425.20124) 64-bit and Power BI Desktop Version: 2.127.1327.0 64-bit 

let
    Source = Table.FromColumns({{1..3}, {"a"}},
        type table [A=Int64.Type, B=Text.Type]
    ),
    Profiled = Table.Profile(Source),

    Issue = Table.SelectRows(Profiled, each [NullCount] = 0),
    // ==> Expression.Error: The field 'NullCount' of the record wasn't found
    
    Workaround1 = Table.SelectRows(
        Table.SelectColumns(Profiled,
            // Same error with: Table.ColumnNames(Profiled)
            {"Column", "Min", "Max", "Average", "NullCount"}
        ),
        each [NullCount] = 0
    ),
    Workaround2 = Table.SelectRows(
        Table.TransformColumnTypes(Profiled, {{"NullCount", Int64.Type}}),
        each ([NullCount] = 0)
    )
in
    Workaround2

 

Frown sent

  • Lorenzo 

    It works as

     

    let
        Source = Table.FromColumns({{1..3}, {"a"}},
            type table [A=Int64.Type, B=Text.Type]
        ),
        Profiled = Table.Profile(Source),
        Issue = Table.SelectRows(Profiled, each [NullCount] = 0),
        // ==> Expression.Error: The field 'NullCount' of the record wasn't found
        
        WokrsAs = Table.SelectRows( Table.StopFolding( Profiled ), each ([NullCount] = 0)
        )
    
    in
        WokrsAs

     

    Table.Profile - Function | Power Query How

Resources