Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I use the data source 'Hashtag items' in a query. This report gets refreshed monthly and I got an error in the most recent execution I got this erros
When checking the source step in the query I got this picture
Then I compared 'Source' with an earlier month and found 3 additional columns. Using this file the error disappeared
There's no change to the source system or report so firstly what do these details mean and why would this be different? Can I update the actual query - = Excel.Workbook(File.Contents(Filepath & "Hashtag Items.xlsx"), null, true) - in any way to address this?
FYI, 'Filepath' is determined in the step before; i.e. Filepath = Excel.CurrentWorkbook(){[Name="Filepath"]}[Content]{0}[Column1],
this allows me to place the source files into any folder without hardcoding it.
Solved! Go to Solution.
Hi @thomasfmeier ,
The error you encountered and its resolution likely relate to how Power Query handles schema changes in your data source, particularly the addition of new columns. Let's break down the elements and address your questions:
Here's an example of how to make the Source step more flexible:
let Filepath = Excel.CurrentWorkbook(){[Name="Filepath"]}[Content]{0}[Column1], Source = Excel.Workbook(File.Contents(Filepath & "Hashtag Items.xlsx"), null, true), ColumnsToKeep = {"Column1", "Column2", "Column3"}, // Adjust based on your actual column names FilteredTable = Table.SelectColumns(Source, ColumnsToKeep) in FilteredTable
This approach ensures that your query works even if additional columns are added to the file.
Error Due to Schema Mismatch: Power Query expects the source data's schema (e.g., column names and their order) to remain consistent. If columns are added, removed, or renamed in the source file, it may cause errors.
Resolution by Updating the File: Using a file with the additional columns resolved the issue because it matched the schema Power Query expected at that step.
Source Step:
= Excel.Workbook(File.Contents(Filepath & "Hashtag Items.xlsx"), null, true)
Filepath Step:
Filepath = Excel.CurrentWorkbook(){[Name="Filepath"]}[Content]{0}[Column1]
Power Query determines the schema of the file at the time the query is created or refreshed. If the file's structure changes (e.g., new columns are added), it may not align with the query's expectations, causing errors.
While the source system may not have changed, the version of the file used for the query might include updates (e.g., additional columns). This mismatch can cause errors.
To make your query more robust against schema changes, you can update it as follows:
Dynamically Detect Columns:
= Table.SelectColumns(Source, List.FirstN(Table.ColumnNames(Source), X))Replace X with the number of columns you want to process, or adapt based on column names.
Ignore Extra Columns:
= Table.RemoveColumns(Source, List.Difference(Table.ColumnNames(Source), ExpectedColumns))Replace ExpectedColumns with a list of column names you want to retain.
Adjust Based on New Schema:
Thanks for reaching out to the Microsoft forum community. Sorry for the delay in response, based on the concerns that you're facing issues when refreshing the report, especially related to schema changes in the source file.
If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Hi @thomasfmeier
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @thomasfmeier,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @thomasfmeier
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @thomasfmeier ,
The error you encountered and its resolution likely relate to how Power Query handles schema changes in your data source, particularly the addition of new columns. Let's break down the elements and address your questions:
Here's an example of how to make the Source step more flexible:
let Filepath = Excel.CurrentWorkbook(){[Name="Filepath"]}[Content]{0}[Column1], Source = Excel.Workbook(File.Contents(Filepath & "Hashtag Items.xlsx"), null, true), ColumnsToKeep = {"Column1", "Column2", "Column3"}, // Adjust based on your actual column names FilteredTable = Table.SelectColumns(Source, ColumnsToKeep) in FilteredTable
This approach ensures that your query works even if additional columns are added to the file.
Error Due to Schema Mismatch: Power Query expects the source data's schema (e.g., column names and their order) to remain consistent. If columns are added, removed, or renamed in the source file, it may cause errors.
Resolution by Updating the File: Using a file with the additional columns resolved the issue because it matched the schema Power Query expected at that step.
Source Step:
= Excel.Workbook(File.Contents(Filepath & "Hashtag Items.xlsx"), null, true)
Filepath Step:
Filepath = Excel.CurrentWorkbook(){[Name="Filepath"]}[Content]{0}[Column1]
Power Query determines the schema of the file at the time the query is created or refreshed. If the file's structure changes (e.g., new columns are added), it may not align with the query's expectations, causing errors.
While the source system may not have changed, the version of the file used for the query might include updates (e.g., additional columns). This mismatch can cause errors.
To make your query more robust against schema changes, you can update it as follows:
Dynamically Detect Columns:
= Table.SelectColumns(Source, List.FirstN(Table.ColumnNames(Source), X))Replace X with the number of columns you want to process, or adapt based on column names.
Ignore Extra Columns:
= Table.RemoveColumns(Source, List.Difference(Table.ColumnNames(Source), ExpectedColumns))Replace ExpectedColumns with a list of column names you want to retain.
Adjust Based on New Schema:
Thanks for the response.
If I understand this correctly you refer to changes to the file layout; e.g. addition/removal of columns, right?
Does your response apply to the following 2 conditions:
Thanks for reaching out to the Microsoft forum community. Sorry for the delay in response, based on the concerns that you're facing issues when refreshing the report, especially related to schema changes in the source file.
If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
9 | |
8 | |
7 |
User | Count |
---|---|
17 | |
10 | |
7 | |
6 | |
6 |