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.
It seems like the issue is that the reference to "Sample File" isn't recognized in the context of your Excel query. In Power BI, when you use the #"Transform File" function, it's typically referring to a sample structure used during transformation. If Excel can't find "Sample File", it's because this reference is dynamic and needs to be explicitly defined.
To fix it, identify the Transform Function: You need to replace #"Transform File"(#"Sample File") with an actual reference to the function or a properly defined sample.