Open-source tool to migrate IBM Cognos reports and models to Microsoft Power BI (PBIP / TMDL / PBIR) with AI assistance.
Project description
Cognos to Power BI Migration Tool
Migrate IBM Cognos reports and models to Microsoft Power BI automatically. An open-source, AI-assisted migration engine that converts Cognos report specifications into Power BI Project (PBIP) format using TMDL semantic models and PBIR report definitions.
What this project does
Organizations moving from IBM Cognos Analytics to Microsoft Power BI face a slow, manual, error-prone migration. This tool automates the heavy lifting:
- Parse Cognos report specification XML, Framework Manager models, and data modules.
- Normalize them into a vendor-neutral intermediate representation (IR).
- Model the result as a Power BI star schema: classify fact and dimension tables, orient relationships, infer cardinality and cross-filter direction, and mark date tables.
- Generate Power BI Project (PBIP) output: TMDL semantic models and PBIR reports.
- Refine the output with an AI assistant (Claude, GitHub Copilot, or Codex) to translate expressions, layouts, and visuals that have no direct mechanical mapping.
The result is a Git-friendly Power BI project you can open in Power BI Desktop, review, and deploy to the Power BI / Microsoft Fabric service.
Why use it
- Faster migrations. Convert hundreds of reports in a fraction of the manual time.
- Consistent output. Deterministic, reviewable PBIP artifacts instead of hand-rebuilt reports.
- AI-assisted, not AI-dependent. The mechanical conversion works without any AI key; AI only refines what cannot be mapped deterministically.
- Provider-agnostic AI. Use Claude Code CLI, GitHub Copilot CLI, or OpenAI Codex CLI.
- Open and extensible. MIT-licensed, plugin-friendly parsers and generators.
Supported conversions
| Cognos source | Power BI target | Status |
|---|---|---|
| Report specification (Report Studio XML) | PBIR report + TMDL tables | Available (beta) |
| Queries and data items | TMDL columns and measures | Available (beta) |
Framework Manager model (.cpf / FM XML) |
TMDL semantic model | Available (beta) |
| Relational joins | Star-schema relationships with cardinality and cross-filter | Available (beta) |
| Data Modules | TMDL semantic model | Planned |
| Dashboards | PBIR report pages | Planned |
The star-schema modeling pass classifies fact, dimension, and date tables, hides foreign keys,
resolves role-playing dimensions and ambiguous filter loops, and flags many-to-many and snowflake
joins for review. Disable it with --no-infer-model. See data modeling
for the full behavior and edge-case handling.
See the migration coverage matrix for detail on expressions, filters, and visual types.
Quick start
# Install
pip install cognos2powerbi
# Convert a single Cognos report specification to a Power BI project
cognos2pbi migrate ./examples/sample_report.xml --out ./out/SalesReport
# Point the generated model at your database (refreshable PBIP)
cognos2pbi migrate ./examples/sample_report.xml --out ./out/SalesReport \
--server sql01.contoso.com --database Sales
# Convert a Cognos Framework Manager model to a Power BI semantic model
cognos2pbi migrate-model ./examples/sample_model.xml --out ./out/SalesModel
# Infer a full star schema (fact/dimension roles, relationships, date tables)
cognos2pbi migrate-model ./examples/star_schema_model.xml --out ./out/RetailStar
# Open the generated project
# ./out/SalesReport/SalesReport.pbip -> open in Power BI Desktop
Run from source instead:
git clone https://github.com/navintkr/cognos-to-powerbi.git
cd cognos-to-powerbi
pip install -e ".[dev]"
cognos2pbi migrate ./examples/sample_report.xml --out ./out/SalesReport
End-to-end demo (complex report on local SQL Server)
This walkthrough migrates a complex Cognos report, wires the generated model to a local SQL Server database, and opens a refreshable Power BI Project. Everything it needs ships in the repo:
- examples/complex_sales_report.xml - a Cognos report with
three queries (FactSales, DimProduct, DimDate), typed columns, six aggregate measures
(including translated arithmetic such as
Gross ProfitandNet Revenue), and three pages of list, crosstab, column, line, and pie visuals. - examples/sql/setup_demo_db.sql - creates the matching
CognosDemodatabase with sample data. Table and column names line up with the report, so the generated PBIP refreshes with no manual edits.
Step-by-step video
Walkthrough video: add your recording link here (for example a Loom or YouTube URL). Suggested flow to record: run the SQL script, run
cognos2pbi migrate, open the.pbipin Power BI Desktop, set theServer/Databaseparameters, then Refresh.
1. Install the demo database
Requires a local SQL Server instance and sqlcmd. Using a default instance with Windows auth:
sqlcmd -S localhost -E -C -i examples/sql/setup_demo_db.sql
This creates CognosDemo with DimProduct (6 rows), DimDate (6 rows), and FactSales
(12 rows).
2. Migrate the report and wire it to local SQL
cognos2pbi migrate examples/complex_sales_report.xml --out out/ComplexDemo `
--source-type sqlserver --server localhost --database CognosDemo --schema dbo
Expected summary: 3 tables, 6 measures, 3 pages, 0 items to review. The generated model uses
Server and Database parameters and a Sql.Database(Server, Database) partition per table.
3. Open and refresh in Power BI Desktop
-
Open
out/ComplexDemo/complex_sales_report.pbipin Power BI Desktop. -
If prompted, confirm the
Server(localhost) andDatabase(CognosDemo) parameters. -
Refresh. The measures evaluate against live data, for example:
Total Revenue Gross Profit Net Revenue Avg Unit Price Total Quantity 1,751,000.00 663,000.00 1,663,450.00 741.67 3,810
To point at a different server, change --server / --database, or edit the Server and
Database parameters in Power BI Desktop after opening the project.
AI-assisted refinement (optional)
Enable an AI provider to translate complex Cognos expressions and layouts into Power BI DAX and PBIR visuals. The provider is selected by configuration and shells out to the corresponding CLI.
# Claude Code CLI (default)
cognos2pbi migrate ./report.xml --out ./out/Report --ai claude
# GitHub Copilot CLI
cognos2pbi migrate ./report.xml --out ./out/Report --ai copilot
# OpenAI Codex CLI
cognos2pbi migrate ./report.xml --out ./out/Report --ai codex
If no AI provider is configured, the tool completes a deterministic conversion and flags items that need manual review. See docs/ai-providers.md.
How it works
flowchart LR
A[Cognos artifacts<br/>report XML, FM model, data module] --> B[Parsers]
B --> C[Intermediate Representation<br/>vendor-neutral IR]
C --> D[PBIP Generators<br/>TMDL + PBIR]
D --> E[AI Refinement<br/>Claude / Copilot / Codex]
E --> F[Power BI Project<br/>.pbip]
The intermediate representation decouples parsing from generation, so new Cognos inputs and new Power BI output formats can be added independently. See docs/architecture.md.
Project layout
cognos-to-powerbi/
├── src/cognos2powerbi/
│ ├── cli.py # Command-line interface
│ ├── core/
│ │ ├── ir/ # Vendor-neutral intermediate representation
│ │ ├── parsers/ # Cognos report/model parsers
│ │ ├── generators/ # PBIP (TMDL + PBIR) generators
│ │ ├── translate/ # Deterministic Cognos-to-DAX translation
│ │ ├── ai/ # Provider-agnostic AI adapter
│ │ └── pipeline.py # Orchestration
│ └── api/ # FastAPI backend (SaaS surface)
├── web/ # Single-page web frontend
├── examples/ # Sample Cognos inputs
├── docs/ # Documentation
└── tests/ # Test suite
Run the SaaS API locally
pip install -e ".[api]"
uvicorn cognos2powerbi.api.main:app --reload
# Open the web UI at http://127.0.0.1:8000/
# Or POST a Cognos report to http://127.0.0.1:8000/api/v1/migrate
Roadmap
- Framework Manager model conversion to TMDL
- Expression translation library (Cognos to DAX)
- Parameterized data-source wiring for refreshable PBIP
- Data Module conversion
- Dashboard to PBIR page mapping
- Hosted SaaS portal with upload, review, and download
- Batch / folder migration with a coverage report
Full roadmap: docs/roadmap.md.
Contributing
Contributions are welcome and wanted. Good first issues are labeled
good first issue.
Read CONTRIBUTING.md and the Code of Conduct to get started.
Security
Report vulnerabilities privately per our security policy. Do not open public issues for security reports.
License
Licensed under the MIT License.
Keywords
Cognos to Power BI, Cognos Power BI migration, IBM Cognos migration tool, convert Cognos reports to Power BI, Cognos report converter, Power BI PBIP TMDL PBIR generator, business intelligence migration, automated report migration.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cognos2powerbi-0.2.0.tar.gz.
File metadata
- Download URL: cognos2powerbi-0.2.0.tar.gz
- Upload date:
- Size: 48.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96cefd2bdb034dbb174b6d43d28cea60484c534efdd866bb2b012ae07b9b7b4d
|
|
| MD5 |
a9e85780f3d510e16ac3362512aae317
|
|
| BLAKE2b-256 |
97516ab396085618cb7f0dbf4ae1c73fdfb82001707ac0d1796d803b8f6ed9f9
|
Provenance
The following attestation bundles were made for cognos2powerbi-0.2.0.tar.gz:
Publisher:
publish.yml on navintkr/cognos-to-powerbi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognos2powerbi-0.2.0.tar.gz -
Subject digest:
96cefd2bdb034dbb174b6d43d28cea60484c534efdd866bb2b012ae07b9b7b4d - Sigstore transparency entry: 2023548310
- Sigstore integration time:
-
Permalink:
navintkr/cognos-to-powerbi@6f1f715648835a9a4d250f3317c380105ff9781d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/navintkr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6f1f715648835a9a4d250f3317c380105ff9781d -
Trigger Event:
release
-
Statement type:
File details
Details for the file cognos2powerbi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: cognos2powerbi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 36.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbecade973c893c86fab55bb5d3da8f755128b17288e2798430c16674f4361e7
|
|
| MD5 |
642ad69437a82777a7079724f2369174
|
|
| BLAKE2b-256 |
c08d41fe90379bdc9268b2bc588ea59ba093c74561aa11c056180f934db8858d
|
Provenance
The following attestation bundles were made for cognos2powerbi-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on navintkr/cognos-to-powerbi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognos2powerbi-0.2.0-py3-none-any.whl -
Subject digest:
bbecade973c893c86fab55bb5d3da8f755128b17288e2798430c16674f4361e7 - Sigstore transparency entry: 2023548481
- Sigstore integration time:
-
Permalink:
navintkr/cognos-to-powerbi@6f1f715648835a9a4d250f3317c380105ff9781d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/navintkr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6f1f715648835a9a4d250f3317c380105ff9781d -
Trigger Event:
release
-
Statement type: