#REF error after Power Query refresh

Frequent Contributor

I create a table using a Power Query. Next to this table I added columns with formulas referencing the table (eg. [@ProductRef] or tCalc[@ProductRef]). This works fine until I refresh the Power Query, then I get #REF errors.

I have use the same method in other worksheets, and it works fine there. What could be going wrong in this one?


I already tried changing the External Data Properties, didn't help.



14 Replies



cannot be done that way, please provide a sample file since power query is a complicated function to explain.



Thank you for looking into this!

Attached a simplified sample workbook. Strangely enough, in the sample workbook everything works, while in my real file, which does basically the same, I get the #REF error.

Still, it would be great if you could look into the sample workbook and advise on best practice.



So var is the price * Qty



Question: I am assuming the PQ result is the fact table? How is that going to work when you switch the parameters from B to A, do a refresh and then when coming back to B and do a refresh the values you entered for the A supplier will disappear.

Yes, that's not a problem. The user chooses a supplier, then fills in values, then copies the results. So it's okay for the values to disappear once the calculation has been made.
To make things even stranger, the exact same file that gave #REF errors yesterday, works fine now...



Then your problem has been solved.

@Yea_So Well, kind of. I don't really like stuff that doesn't work and then magically starts to work, doesn't give me a lot of confidence... But, yes, short term, the problem seems to have disappeared...



I know that feeling, you can try a different angle, instead of adding columns to the power query resultant, you can create a table where the user will input the parameter values and do a SUMIF power query style:

- - - My Courses - - - - ✔️ Mastering DAX in Power BI - ✔️ Power Query Course- ✔️ Master Excel Step by Step- ✔️ Business Intelligence Dashboards- ...

Hi @bartvana 

Based on the sample you uploaded I would advise you to do a merge in Power Query between tables tSupplierProduct and tProductRef, instead of performing an XLOOKUP. That would reduce the risk of issues like the one you've been experiencing


Hope this makes sense

Hi @Yea_So 

Just in case, there's an easier and more efficient way to perform the SUMIFS done in the above video

Hi @L z. 


any input from you is appreciated.  Thank you

best response confirmed by bartvana (Frequent Contributor)

@L z. & @bartvana 


A power query + data model + power pivot solution can also be considered by creating relationships from supplier table and product table as dim tables (lookup tables) to the  parameter/calc table (fact table) then, display the results into a power pivot especially if supplier/product calculation is high volume would be most efficient.

@Yea_So 2 options in the attached file



Well there you have it @bartvana courtesy of @L z. your suggested solution.  Thank you @L z. .

OK, thank you!