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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Cram
New Member

The column '...' of the table wasn't found. Refresh broken only web

Hello mates,

i wrote a PowerBI connector in M which connects to a REST api and now i got a problem with the refresh of my data but only
in the web version, in the desktop version it works fine.
I read more than 15 threads e.g.
https://community.powerbi.com/t5/Service/The-HasUniqueRoleAssignments-column-does-not-exist-in-the-r...
but that's about deleting the column which causes the failure and i need that column.
"The column '...' of the table wasn't found" is the error message.

getData = (json, contentType, pos) =>
    let
        records = Table.FromRecords({json}),
        listExpanded = Table.ExpandListColumn(records, pos),
        result = ExpandAllRecords(listExpanded)
    in
        result;



ExpandAllRecords expands and renames the columns, removes the "record" in front of each column (from "record.XXX" to "XXX")

 ExpandAllRecords = (TableToExpand as table, optional ColumnNumber as number) =>
    let
        ActualColumnNumber = if (ColumnNumber=null) then 0 else ColumnNumber,
        ColumnName = Table.ColumnNames(TableToExpand){ActualColumnNumber},
        ColumnContents = Table.Column(TableToExpand, ColumnName),
        ColumnsToExpand = List.Distinct(List.Combine(List.Transform(ColumnContents, 
            each if _ is record then Record.FieldNames(_) else {}))),
        NewColumnNames = List.Transform(ColumnsToExpand, each _),
        CanExpandCurrentColumn = List.Count(ColumnsToExpand)>0,
        ExpandedTable = if CanExpandCurrentColumn 
            then 
            Table.ExpandRecordColumn(TableToExpand, ColumnName, 
                    ColumnsToExpand, NewColumnNames) 
            else 
            TableToExpand,
        NextColumnNumber = if CanExpandCurrentColumn then ActualColumnNumber else ActualColumnNumber+1,

        OutputTable = if NextColumnNumber>(Table.ColumnCount(ExpandedTable)-1) 
                  then 
                  ExpandedTable 
                  else 
                  ExpandAllRecords(ExpandedTable, NextColumnNumber)
    in
        OutputTable;


Nothing fancy and nothing with hardcoded count of columns.
I got about 20 different tables and that one is the only one which won't work.

Best regards

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @Cram 

I would suggest you create a support ticket here to get further help.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors