Skip to content

[Power BI] Fix SkuMeterName column error in storage reports for FOCUS 1.2 exports - #2333

Merged
Michael Flanakin (flanakin) merged 12 commits into
devfrom
xe/issue-2332-de385a
Oct 15, 2026
Merged

Michael Flanakin (flanakin) merged 12 commits into
devfrom
xe/issue-2332-de385a

Conversation

@flanakin

Copy link
Copy Markdown
Collaborator

🤖 [AI] Fixes #2332

Problem

Storage reports fail to refresh with Expression.Error: The column 'SkuMeterName' of the table wasn't found when 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 it SkuMeter, and the non-1.2 branch and the following Align12 step already use SkuMeter. 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

…OCUS 1.2 exports

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 21, 2026 06:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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>
@RolandKrummenacher

Roland Krummenacher (RolandKrummenacher) commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Michael Flanakin (@flanakin), I pushed four commits on top of your branch. Could you review them before this merges?

  • 42eea93: adds a PowerQueryColumnNames lint rule, since CI doesn't run Power Query
  • 9a22d26: removes x_SkuMeterName from the FOCUS 1.2 column list in metadata.md
  • e7e11e0: handles FOCUS 1.2 exports that carry no 1.0 columns (EnsureRenamedCols adds whichever side is missing as null; Align12 copies values in both directions; Has12 is gone)
  • 49f1d11: folds the column guard into a _ensureCol helper

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 properties.extendedProperties.region and .Region on AdvisorReservationRecommendations, which may be what blocked loading the project in Power BI Desktop. Filed as #2347.

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>
@flanakin

Copy link
Copy Markdown
Collaborator Author

🤖 [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.

  • Costs_transform_v1_2 backfilled PricingCurrency from x_PricingCurrency before detecting the FOCUS version, so FOCUS 1.0 data was labeled 1.2 in x_SourceVersion and skipped the 1.0-specific fixes.
  • Version detection now uses the value the export delivered (tmp_PricingCurrency).
  • Confirmed on ftk-dev: every row in Costs_final_v1_2 was labeled 1.2 or 1.2-preview with no InvoiceId or SkuMeter.
  • Added a changelog entry. KQL join, operator, and Power Query lint tests pass.

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>
@flanakin

Copy link
Copy Markdown
Collaborator Author

🤖 [AI][Claude] PR Update Summary

Simplified the version-detection fix: the PricingCurrency backfill from x_PricingCurrency now runs after x_SourceVersion detection, so the tmp_PricingCurrency copy is no longer needed. Behavior is unchanged. KQL join and operator lint tests pass.

@flanakin
Michael Flanakin (flanakin) merged commit f12c29e into dev Oct 15, 2026
14 checks passed
@flanakin
Michael Flanakin (flanakin) deleted the xe/issue-2332-de385a branch October 15, 2026 17:57

This branch was successfully deployed

1 active deployment
ftk-pr — 83d88f0b Deployed Oct 15, 2026 by flanakin via Clean up PR resources #73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Review 👀 PR that is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting this error Expression.Error: The column 'SkuMeterName' of the table wasn't found. Details: SkuMeterName

4 participants