Skip to content

[pbi-fixer] Add add_measures_from_columns: auto-create explicit measures from numeric columns based on SummarizeBy - #1216

Open
KornAlexander wants to merge 2 commits into
microsoft:mainfrom
KornAlexander:feature/add-measures-from-columns
Open

[pbi-fixer] Add add_measures_from_columns: auto-create explicit measures from numeric columns based on SummarizeBy#1216
KornAlexander wants to merge 2 commits into
microsoft:mainfrom
KornAlexander:feature/add-measures-from-columns

Conversation

@KornAlexander

Copy link
Copy Markdown

Adds a sempy_labs fixer add_measures_from_columns() that auto-create explicit measures from numeric columns based on SummarizeBy.

Adds one source file (src/sempy_labs/semantic_model/_Add_MeasuresFromColumns.py) plus one re-export line in the matching __init__.py. No other files touched, no shared helpers, no dependency on any other PR.

Part of the PBI Fixer contribution. Tracking issue: #1185

Copilot AI review requested due to automatic review settings May 5, 2026 12:40

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.

Pull request overview

Adds a new semantic model utility add_measures_from_columns() intended to auto-create explicit measures from columns based on the column SummarizeBy setting, optionally placing measures into a dedicated measures table and supporting a scan-only (“dry run”) mode.

Changes:

  • Added add_measures_from_columns() implementation that scans model columns, generates DAX aggregations, creates measures, and hides source columns.
  • Added re-export of add_measures_from_columns in sempy_labs.semantic_model package __init__.py.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/sempy_labs/semantic_model/_Add_MeasuresFromColumns.py Implements measure auto-creation from columns based on SummarizeBy, with optional target/auto-detected measures table and scan-only output.
src/sempy_labs/semantic_model/__init__.py Re-exports the new function via __all__.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sempy_labs/semantic_model/_Add_MeasuresFromColumns.py
Comment thread src/sempy_labs/semantic_model/_Add_MeasuresFromColumns.py
Comment thread src/sempy_labs/semantic_model/_Add_MeasuresFromColumns.py
Comment thread src/sempy_labs/semantic_model/_Add_MeasuresFromColumns.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants