Skip to content

[pbi-fixer] Add add_calc_group_time_intelligence: add a Time Intelligence calc group (YTD, MTD, PY, YoY, ...) - #1215

Open
KornAlexander wants to merge 2 commits into
microsoft:mainfrom
KornAlexander:feature/add-calc-group-time-intelligence
Open

[pbi-fixer] Add add_calc_group_time_intelligence: add a Time Intelligence calc group (YTD, MTD, PY, YoY, ...)#1215
KornAlexander wants to merge 2 commits into
microsoft:mainfrom
KornAlexander:feature/add-calc-group-time-intelligence

Conversation

@KornAlexander

Copy link
Copy Markdown

Adds a sempy_labs fixer add_calc_group_time_intelligence() that add a Time Intelligence calc group (YTD, MTD, PY, YoY, ...).

Adds one source file (src/sempy_labs/semantic_model/_Add_CalcGroup_TimeIntelligence.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

This PR adds a new semantic model “fixer” function, add_calc_group_time_intelligence(), intended to create a standard “Time Intelligence” calculation group in the semantic model behind a given Power BI report (or report scan-only), and re-exports it from sempy_labs.semantic_model.

Changes:

  • Added add_calc_group_time_intelligence() implementation to create a “Time Intelligence” calculation group (AC/Y-1..Y-3/YTD.. and variance items) using TOM operations.
  • Added a corresponding re-export in src/sempy_labs/semantic_model/__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_CalcGroup_TimeIntelligence.py New fixer that scans for an existing TI calc group, finds the calendar table/date column, and creates a TI calculation group + items.
src/sempy_labs/semantic_model/__init__.py Re-exports add_calc_group_time_intelligence via import and __all__ update.

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

Comment thread src/sempy_labs/semantic_model/_Add_CalcGroup_TimeIntelligence.py
Comment thread src/sempy_labs/semantic_model/_Add_CalcGroup_TimeIntelligence.py
Comment thread src/sempy_labs/semantic_model/_Add_CalcGroup_TimeIntelligence.py
Comment thread src/sempy_labs/semantic_model/_Add_CalcGroup_TimeIntelligence.py
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