Forum Discussion
Query Parameter - Different columns between sources results in a failed refresh
- 8 months ago
Hi Foxxon28
What you’re seeing is expected behavior: in the Power BI Service the dataset refresh is schema-validated, so if a column referenced anywhere in the model (Power Query, relationships, measures, or visuals) does not exist in the current source, the entire refresh fails, unlike Desktop which is more forgiving at design time. Query parameters only swap the connection — they do not abstract schema differences — so Dev/Test/Prod must be structurally identical if you want pipelines to work reliably. The only safe workaround is to standardize the schema by exposing views in each environment that always return the same columns (add NULL or default values for missing columns in Prod), or use Power Query to add missing columns with nulls before loading. If the schemas aren’t aligned, deployment pipelines + parameters will keep breaking in the Service.
Hello Foxxon28
Workarounds
1. Align Schemas Across Environments
- Ensure that Test, Dev, and Production have the same column structure, even if some columns are unused in Production.
- You can add placeholder columns in Production (e.g., ALTER TABLE ADD [NewColumn] NULL) so the schema matches.
2. Use Power Query Conditional Logic
- Instead of relying on Query Parameters alone, add logic to handle missing columns:
let
Source = Sql.Database(ParameterServer, ParameterDB),
Table = Source{[Schema="dbo",Item="MyTable"]}[Data],
Adjusted = Table
// Add missing columns if they do not exist
& if Table.ColumnNames(Table) <> {"ExtraColumn"} then Table.AddColumn(Table, "ExtraColumn", each null) else Table
in
Adjusted
If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.
Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.