Forum Discussion
How to create custom error messages for missing tables/columns in Power BI Template App
Hi Community,
I am building a Power BI Template App connected to Snowflake.
In Power BI Desktop, when required tables or columns are missing, the error message clearly shows which table/column is missing.
But in the Service (Template App), users only see a generic "Refresh failed" message.
I want to create a custom error message that:
- Lists missing tables (e.g., RETURNS, FINANCE)
- Lists missing columns (e.g., ACCOUNT_ID, SIZE_MATCH)
- Shows a friendly card visual like "⚠️ Issues Found" or "✅ All required tables are present"
I have tried M code like:
```M
let
Source = _BaseSchema_Snowflake,
RawTable = Source{[Name = "ACCOUNT_SCORES", Kind = "Table"]}[Data],
RequiredColumns = {
"COLUMN 1",
"COLUMN 2",
"COLUMN 3",
"COLUMN 4",
"COLUMN 5",
"COLUMN 6"
},
MissingColumns =
List.Difference(RequiredColumns, Table.ColumnNames(RawTable)),
ValidatedTable =
if List.IsEmpty(MissingColumns)
then RawTable
else error
"ACCOUNT_SCORES table is missing required columns: "
& Text.Combine(MissingColumns, ", ")
in
ValidatedTable
You generally cannot reliably surface those custom refresh-time errors as a report visual in the Service, because when refresh fails, the dataset/model isn’t updated, and visuals can’t render “new” status coming from that failed refresh. In Template Apps, users often only see the generic refresh failure summary.
4 Replies
- cengizhanarslanSuper User
You generally cannot reliably surface those custom refresh-time errors as a report visual in the Service, because when refresh fails, the dataset/model isn’t updated, and visuals can’t render “new” status coming from that failed refresh. In Template Apps, users often only see the generic refresh failure summary.
- lbendlinSuper User
You cannot use error handling for missing tables. These always require a manual meta data refresh.
There are functions in Power Query to handle missing columns, however the final query output meta data will be cached which will again result in an error message that you can only clear via a schema refresh.
- v-prasareCommunity Support
Hi Arunthathi
We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.
lbendlin & cengizhanarslan, Thanks for prompt response.
Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support - v-prasareCommunity Support
Hi Arunthathi,
We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.
Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support