Forum Discussion

PowerBI_Chaos's avatar
2 years ago
Solved

Dataflow: Traceback Invalid Cell Value Errors to Source

Hello all,

 

Needing some guidance! Hopefully there is a simple solution available!

 

I am working through several power BI report dataflows (through Fabric) which have errors relating to Pipeline Exceptions, Invalid Cell Value. However, when I go into the power query none of the steps are erroring out due to this openly, only the Pipeline is. However, I do see the error arise if I try to open the filters on the query and load more.

 

Typically, I would simply open the datasource and CTRL + F for the erroneous value...

 

The trouble is that the report is using a custom function to pull data from a folder full of templated spreadsheets into one consolidated view. I cannot tell which workbook the data error is stemming from.

 

My question is: Is there a method in Power BI to quickly and easily identify the source of the errors in the Excel workbooks they are pulling from?

 

Here is the error, as seen from Fabric dataflow refresh:

 

Error: DataFormat.Error: Invalid cell value '#REF!'. . RootActivityId = efe8610d-fb49-442c-ace3-09d4f9d8a6af.Param1 = DataFormat.Error: Invalid cell value '#REF!'. Request ID: 19fda3b9-bf43-485c-af05-11b147f97b8f.

  • I was able to resolve this issue by inserting a temporary step after the folder of excel workbooks is loaded into the query, which filtered the workbooks down by name into batches (beginning with).  Using this I was able to test batches of about 5-10 at a time, until I narrowed it down to the two files which were throwing the "#REF!" errors.  I opened them up, cleared up the formulas generating the errors, and now the dataflow is working again.  

7 Replies

  • 123abc's avatar
    123abc
    Community Champion

    Identifying the exact workbook, sheet, row/column, and cell causing errors in Power BI dataflows can be a bit challenging, but it is possible with a systematic approach. Here are some steps you can follow to pinpoint the source of the errors:

    1. Check Data Sources:

      • First, verify the data sources you are pulling from. Ensure that the data is well-structured and does not contain any issues like #N/A or #REF! errors. Sometimes these errors originate in the source data.
    2. Dataflow Query Errors:

      • In Power BI, when you load data into a dataflow, the Power Query Editor performs transformations on the data. Check the query editor for each dataflow. Look for any steps that might introduce errors like dividing by zero, referencing invalid cells, or handling missing values incorrectly. Fix any such issues within the Power Query Editor.
    3. Column Profiling:

      • Use the "Column Profiling" feature in Power Query Editor to analyze the data and identify anomalies. This can help you identify which columns might be causing issues. To use this feature, select a column and go to the "View" tab in Power Query Editor, then choose "Column Profiling."
    4. Data Lineage:

      • In Power BI, data lineage can help you understand where data is coming from and where it's going. Use the "Data lineage view" to trace back to the data source and identify the problematic cell in Excel. This view might show you the path from the source data to the error in the pipeline.
    5. Error Handling in Power Query:

      • In Power Query, you can implement custom error handling to capture and record problematic cells. For example, you can add custom columns that flag rows containing errors or invalid values. This can make it easier to identify the source.
    6. Testing Individual Steps:

      • You mentioned that none of the steps in Power Query are showing errors. It's possible that the issues are arising during the merge or transformation steps. You may need to isolate and test individual steps to identify which one introduces the error.
    7. Excel Workbook Audit:

      • If the issue persists, you might have to audit the Excel workbooks manually. Open the Excel files used as data sources, and look for the specific cells or formulas that contain #N/A or #REF!. Once you identify these cells, you can decide how to handle them in your Power Query transformations.
    8. Data Validation:

      • Implement data validation in your Excel workbooks. This can help prevent invalid values from getting into your dataflow in the first place. You can use Excel's data validation features to restrict the input to acceptable values.
    9. Error Logging:

      • Consider implementing error logging within Power Query or in the data loading process to track and capture errors as they occur. This can help you pinpoint the exact location of problematic data.
    10. Consult Power BI Community:

      • If you are still facing difficulties, consider posting your issue on the Power BI community forums. Experienced Power BI users might be able to provide specific advice based on your report and dataflow structure.

    Identifying the exact source of these errors may require a combination of these methods, as well as careful examination of both the Power Query steps and the source Excel files.

  • Hi PowerBI_Chaos ,

     

    #REF! and #N/A are Excel errors, not Power Query errors, so you're correct to want to trace this back to the Excel source.

    To get this identified quickly you need to first: ignore generic ChatGPT answers, second; do it in Excel (not in the Dataflow). Dataflows are slow to load/filter and the rows aren't guaranteed to be in the same order as your source anyway.

     

    In your Excel file you can either:

    -1- Hit F5 (Go To), click on 'Special', select 'Formulas' radio button, and check the 'Errors' box.

    -2- Hit Ctrl+F, type #REF! or #N/A in the Find field and either 'Find All' or 'Find Next'.

     

    Pete

    • PowerBI_Chaos's avatar
      PowerBI_Chaos
      Helper I

      Hi there,

       

      Thank you for the reply.  I had tried to adjust my post last night, but it appears to have not went through.  While I was able to resolve one of the two, using the exact method mentioned... The problem is that the second power query pulls data from a bunch of excel files in a folder. Is there any way in Power Query to tell which of the files the errors are coming from?  Otherwise I would need to open each and every one of them up, and there are like 50 or more.

       

      I took this over from my predecessor, and am trying to piece it back together.  Pulling data in this manner is not my preferred method.

      • BA_Pete's avatar
        BA_Pete
        Super User

         

        When you say that "the second power query pulls data from a bunch of excel files in a folder", do you mean it uses the Transform & Combine folder connector? You can tell if this is the case as you will have an auto-generated folder of queries called "Helper Queries" or similar.

        If so, then you should see a [Source.Name] column in the combined query (the final one where all the files get combined together, not a helper query) that will tell you exactly which file each row has come from. You may need to click back up the query step list a bit in case this column has been removed in subsequent steps but, once you find it, you can use it identify exactly where your errors have come from.

         

        Pete

  • I was able to resolve this issue by inserting a temporary step after the folder of excel workbooks is loaded into the query, which filtered the workbooks down by name into batches (beginning with).  Using this I was able to test batches of about 5-10 at a time, until I narrowed it down to the two files which were throwing the "#REF!" errors.  I opened them up, cleared up the formulas generating the errors, and now the dataflow is working again.