Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Saide
Frequent Visitor

PowerBI refresh from Excel data source crashes on the only column that has a formula

Good morning All,

 

I have a PowerBI project with data from an Excel stored on SharePoint. Here and then it happens that no data is loaded after refresh into PowerBI. It is after someone has updated values in the file . It seems to be caused by the only column that has a formula (=HLOOKUP($A$1;KPI_ACTIVE_COU;ROW()-1;FALSE). I get Error in the query: DataFormat.Error: Invalid cell value 'VALUE!'

 

The only working fix I found so far was to unhide all the columns. I use the following macro for that:

 

The only solution I found so far that works each time I don't get the data is to go to the source file and unhide all columns using VBA macro that was there in the file:

 

Sub Unhide_All()
'
' Unhide all cells and columns
Dim PageName As Variant
Dim index As Integer
i = 2
Do While i < 20
PageName = Sheets("Column").Range("A" & i).Value
Sheets(PageName).Select
Range("A1").Select
ActiveWindow.FreezePanes = False
Columns("A:N").Select
Selection.EntireColumn.Hidden = False
Columns("A:N").EntireColumn.AutoFit

i = i + 1
Loop
End Sub

 

I do not know why it works but it works. I tried to replicate the issue by hiding/grouping/freezing some columns as I saw that when it was not working some columns/rows were grouped, hidden or frozen etc. and since there is unpivot step in the query that was my suspect no. 1 but the load was always working. Nevertheless if it does not work the above macro to unhide all solves it 🤔

 

In other words how to find the source of this DataFormat.Error: Invalid cell value 'VALUE!' error and how to fix it?

 

Anyone had similar problem maybe? I would appreciate any help.

Thank you!

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Saide 

 

The cause is probably from the formula (=HLOOKUP($A$1;KPI_ACTIVE_COU;ROW()-1;FALSE). From the document of HLOOKUP function, you will see the following argument. Please check where the formula is used. If it is used on the first row, ROW() will return 1, then ROW()-1 will return 0. While 0 is less than 1, which may return this error value. 

vjingzhang_0-1669605431508.png

 

ROW function - Microsoft Support

HLOOKUP function - Microsoft Support

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @Saide 

 

The cause is probably from the formula (=HLOOKUP($A$1;KPI_ACTIVE_COU;ROW()-1;FALSE). From the document of HLOOKUP function, you will see the following argument. Please check where the formula is used. If it is used on the first row, ROW() will return 1, then ROW()-1 will return 0. While 0 is less than 1, which may return this error value. 

vjingzhang_0-1669605431508.png

 

ROW function - Microsoft Support

HLOOKUP function - Microsoft Support

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors