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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.