Repository navigation
[Power BI] Fix SkuMeterName column error in storage reports for FOCUS 1.2 exports - #2333
Conversation
…OCUS 1.2 exports Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Nothing in CI runs Power Query, so a mistyped column name in a .tmdl partition ships and surfaces only as a refresh failure on a customer's report. That is how issue #2332 happened: the FOCUS 1.2 branch of the Costs query searched {"SkuMeterName"}, a column no FOCUS version emits. Two static rules: - Every columnsToSearch literal in Table.ReplaceValue must name a column that exists - from a Cost Management export schema, created by the query itself, or declared on the model table. - References to columns FOCUS 1.2 drops (x_InvoiceId, x_PricingCurrency, x_SkuMeterName) need a Table.HasColumns or _exists guard, because ftk_Storage does no backfill for focuscost. The dropped set is derived from the export schemas rather than hard-coded, so a future FOCUS version updates the rule on its own. Scoped to focuscost partitions: the pricesheet and reservationtransactions datasets reuse some of these names legitimately. Rule 2 baselines the three existing unguarded references in Costs.tmdl as a ratchet. Verified the rule catches the original typo: reverting the one-line fix fails rule 1 with "got 'SkuMeterName'". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The FocusCost 1.2-preview table listed x_SkuMeterName alongside the SkuMeter column that replaced it. Verified against a real FocusCost export (dataVersion 1.2-preview, 105 columns): x_SkuMeterName is not delivered. The 1.0 and 1.0-preview(v1) tables keep the column. The ADF mappings in Exports/schemas already had this right. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The "Handle columns renamed in FOCUS 1.2 gracefully" block read [x_InvoiceId], [x_PricingCurrency] and [x_SkuMeterName] unconditionally, and Align12 passed all three as columnsToSearch. FOCUS 1.2 does not deliver them - verified against a real export (dataVersion 1.2-preview, 105 columns): InvoiceId, PricingCurrency and SkuMeter are present, the three x_ columns are not. ftk_Storage does no backfill for focuscost, so a container holding only 1.2 exports has none of them and the refresh fails with "The column 'x_InvoiceId' of the table wasn't found" - the same class of error as #2332, just one step later. EnsureRenamedCols now adds whichever side is missing as a null column before Align12 copies values in both directions, so 1.0-only, 1.2-only and mixed containers all work. Has12 is gone: the per-column checks replace it and it had no other caller. Lowers the PowerQueryColumnNames rule 2 baseline to zero. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The previous version chained six let bindings named a through f, which reads nothing like the rest of the query - every other step there says what it does (HandlePeview, RemovePreviewCols, Align12). Adds an _ensureCol helper next to the existing _exists / _swapCol / _resetCol, and folds it over the six column names with List.Accumulate, the same idiom CleanColumns uses in expressions.tmdl. Nine lines become four and the placeholder names are gone. No behaviour change. The PowerQueryColumnNames rule now also accepts a column as guarded when it appears in a List.Accumulate name list that folds in _ensureCol. Verified it still bites: replacing EnsureRenamedCols with a plain pass-through makes it report all three columns. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Michael Flanakin (@flanakin), I pushed four commits on top of your branch. Could you review them before this merges?
The lint rule passed on 49f1d11. The PowerShell tests on the latest ms.date commit are waiting on workflow approval. The query change is verified statically only: the storage and KQL datasets declare both |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Costs_transform_v1_2 filled PricingCurrency from x_PricingCurrency before deciding x_SourceVersion, so every FOCUS 1.0 row looked like 1.2. Those rows skipped the 1.0-specific fixes (for example, the savings plan purchase ChargeFrequency correction). Keep the delivered value in tmp_PricingCurrency and use it for version detection. Verified against ftk-dev: all Costs_final_v1_2 rows were labeled 1.2 or 1.2-preview with no InvoiceId or SkuMeter populated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
🤖 [AI][Claude] PR Update Summary Added a fix for a related FinOps hubs bug found while checking the ingestion scripts for the same class of issue as #2332.
|
Move the PricingCurrency backfill below x_SourceVersion detection instead of cloning the delivered value into tmp_PricingCurrency. Nothing between the two positions reads PricingCurrency, so behavior is the same without the extra column. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
🤖 [AI][Claude] PR Update Summary Simplified the version-detection fix: the |
🤖 [AI] Fixes #2332
Problem
Storage reports fail to refresh with
Expression.Error: The column 'SkuMeterName' of the table wasn't foundwhen the export uses FOCUS 1.2.Fix
In the Costs query, the FOCUS 1.2 branch replaced values in a column named
SkuMeterName. FOCUS 1.2 names itSkuMeter, and the non-1.2 branch and the followingAlign12step already useSkuMeter. Updated the 1.2 branch to match.Testing
Not run (requires Power BI Desktop). Verified the column name against
FocusCost_1.2-preview.json.🤖 Generated with Claude Code