Forum Discussion

lopezbec's avatar
lopezbec
Advocate I
4 years ago
Solved

PBI Report issue when table is empty

I created a PBI report that is using a SharePoint list.  Everything was working fine until I deleted the data from the list and I got a error in PBI that a column was missing, so I added some details...
  • edhans's avatar
    edhans
    4 years ago

    That is likely because that FieldValuesAsText isnt' available when the table is empty - in other words, there is nothing to expand, so SharePoint returns nothing.

     

    You may need to go back to your original query, but if it returns 0 records, you need to return a table using #table() that has all of the fields but with null for each field.

    Or, why not build the report with the table populated, and then if there are no records, the refresh will just fail. I don't know if that is acceptable or not. I'd use another report to alert someone that there are no records in the table.

    You are getting into some detailed M code here to overcome an empty report, which to me is bad data, and not something a report should be trying to compensate for. Not without being really good in M code to handle all possibilities. None of what you are trying can be done with the Power Query ribbon. All has to be manually edited.