Forum Discussion

ArchStanton's avatar
ArchStanton
Icon for Power Participant rankPower Participant
1 year ago
Solved

Query Errors

I have recently updated the excel workbook that is the source file for a PowerBI report with an X-Lookup to bring in values into a column. When I refreshed PowerBI I noticed that a 'Query Errors' fol...
  • v-pnaroju-msft's avatar
    1 year ago

    Thankyou, m4ni, for your response.

    Hi ArchStanton,

    We appreciate your inquiry through the Microsoft Fabric Community Forum.

    Based on my understanding, the "Query Errors" folder appears due to data type mismatches caused by the XLOOKUP formula in your Excel source. During a Power BI refresh, if values such as #N/A or unexpected text are detected that do not conform to the expected data type of the column, the "Detected Type Mismatches" step is triggered. Power BI automatically generates an error-tracking query when column values—especially those derived from Excel formulas like XLOOKUP—do not match the defined data types, for example, text appearing in a numeric column.

    Please follow the steps outlined below, which may help resolve the issue:

    1. Modify your Excel formula by wrapping the XLOOKUP with IFERROR(), for example:
      =IFERROR(XLOOKUP(...), "")
    2. Handle errors within Power Query by replacing or suppressing mismatches as shown:
      Table.TransformColumns(Source, {{"ColumnName", each try _ otherwise "Missing"}})
    3. Explicitly apply the correct column data types, for instance:
      Table.TransformColumnTypes(Source, {{"ColumnName", type text}, {"Col2", type number}})
    4. Delete the "Errors in Quality Slide" query and refresh the data. If the issue is resolved properly, this query will not reappear.

    Additionally, for your reference, please find the following helpful links:
    Error handling - Power Query | Microsoft Learn
    Tutorial: Shape and combine data in Power BI Desktop - Power BI | Microsoft Learn
    Best practices when working with Power Query - Power Query | Microsoft Learn

    If our response is helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

    Should you have any further questions, please feel free to contact the Microsoft Fabric community.

    Thank you.