Forum Discussion
Expression Error
- 1 year ago
Hi Tun ,
Thank you for reaching out to the Microsoft Fabric Community. We appreciate your response, jgeddes & Greg_Deckler . The issue likely arises due to missing supporting queries when copying the code from Power BI to Excel.
Please try the following steps to resolve this.
1️. Copy All Supporting Queries - Ensure all supporting queries, including the "Sample File" query and any related queries, are copied when transferring the Power Query code from Power BI to Excel. These queries are automatically created during the file combination process in Power BI and are essential for the script to function.
2️. Recreate the Sample File Query in Excel - If the "Sample File" query is missing or incorrectly referenced, manually recreate it in Excel’s Power Query editor to maintain the correct transformations.
3️. Manually Combine Files [Alternative Approach] - If the issue persists, consider manually loading each file into Excel and then appending them together instead of using the automated file combination feature.
By ensuring all dependencies are present in Excel and adjusting the approach if needed, you should be able to resolve the error.
I hope this helps. Please let me know if you need further clarification.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
Tun Looks like maybe a folder query or something. So, in Power BI there was likely a parameter or other query called "Sample File" but it doesn't exist in Excel.
I am fetching data from the sharepoint folder, it has multiple .csv file. When I transform it in power bi and do all the editing like deleting columns, adding columns blah blah. Now when i click on advance editor and copy the code and paste it in excel to fetch the data in excel, it gives this error. But on the contrary if i load a single file from the same folder, it works perfectly fine when i paste the code in excel.
I have checked on the left pane of power query, the Sample File and Transform file, name is same, it exist as well. But something is wrong.
- jgeddes1 year agoSuper User
#"Sample File" may be referring to the query that is created when using the UI to combine files.
If you are copying code from PBI to Excel you need to copy all of the supporting queries as well.