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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
am_
New Member

Newbie question about referencing data

I have an SQL table. I want it to be retrivied to my excel file. 

1. I use PowerBI to get Data from SQL Server

2. Query1 worksheet shows up with the data.

3. I use formulas like this ='Query1'!D2 in other worksheets to reference the data I want.

 

The problem is that when I delete one row in the SQL table all the worksheets that reference to Query1 do not update. Instead they create monsters like this ='Query1'!#REF!

I learned why it happens. I want to know the solution how to overcome this. 

2 REPLIES 2
AllisonKennedy
Super User
Super User

@am_ 

 

This is a tricky question - why do you want cell D2 in the formulas you're creating? And why are you deleting the row in Excel? If you delete the row from SQL, and refresh the query, then you shouldn't get this problem. Likewise if you can use DAX instead of excel formulas you can eliminate the ref errors, but we need a bit more info to understand what you're trying to acheive. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

If you delete the row from SQL, and refresh the query, then you shouldn't get this problem.

 

This is what I do. I delete the row from SQL then click Refresh All in Excel and cells with #REF appear.

 

EDIT. 

Let me be more precise. For example. I have formulas from ='Query1'!D2 to ='Query1'!D300 in one of my worksheets. I delete one row from SQL (not Excel) then after it is reloaded one formula is changed to ='Query1'!#REF!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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