Forum Discussion
power query Dynamic pivoting and automate data refresh
- Anonymous11 months ago
Hi k_umesh ,
The refresh issue happens because the query uses dynamic pivoting, which means Power Query creates new columns automatically based on whatever JSON keys appear in the data. This works during manual refresh, but scheduled or API refresh cannot handle changing columns, so it fails with errors saying a column doesn’t exist. To fix this, you can use a fixed list of column names instead of letting Power Query create them dynamically, so the table structure stays the same every time. Another easy option is to avoid pivoting in Power Query and let a Matrix visual in Power BI do the pivoting, which keeps the data stable and makes scheduled refresh safe. If your data comes from a database, you can also pivot in SQL by creating a view with a stable set of columns. If you need pivoted columns in your dataset, the best way to go is to stick with a fixed list of pivot columns. That way, your schema stays consistent and you won't run into refresh issues.
https://learn.microsoft.com/en-us/power-bi/connect-data/refresh-data#data-refresh-and-schema-refresh
scheduled refreshes or the Dataset Refresh API do not apply these changes.
Are you getting an error message? Dynamic query?
Yes,Those missing columns are old pivoted columns .
Error returned: 'The '<oii>EL3Boolean</oii>' column does not exist in the rowset