My first contribution to Apache Ossie (incubating) has been merged. PR #76 adds a new export to the Microsoft Power BI converter: an Apache Ossie semantic model can now be written as the semantic model folder of a Power BI project (PBIP), as split TMDL. That’s the format teams keep in Git, and the one Power BI Desktop, Fabric Git integration and fabric-cicd read.
This post walks through a step-by-step example, with screenshots, that you can follow on your own machine.
What is Apache Ossie?
Apache Ossie (formerly Open Semantic Interchange, OSI) is a vendor-neutral YAML format for semantic models: datasets, fields, metrics and relationships. The ossie-converters repository has converters between Ossie and tools like Snowflake, Databricks, dbt, BigQuery and Power BI. The Microsoft converter already turned an Ossie model into a single model.bim (TMSL) file or a single TMDL document. What was missing was the folder layout that real Power BI projects use.
What the feature does
ossie-microsoft export -i model.yaml --pbip out/ # writes out/<name>.SemanticModel/ossie-microsoft export -i model.yaml --pbip out/ --force # replaces the definition of an existing folderossie-microsoft export -i model.yaml --pbip Sales.SemanticModel # writes into that folder itself
from ossie_microsoft import export_powerbi_projectfolder = export_powerbi_project(ossie_yaml, "out/") # returns out/<name>.SemanticModel
The output looks like this:
out/<name>.SemanticModel/ definition.pbism definition/ database.tmdl model.tmdl relationships.tmdl expressions.tmdl tables/ roles/ cultures/ perspectives/
A few design decisions:
- TOM writes the TMDL. The converter builds the model with its existing TMSL export, then hands it to Microsoft’s Tabular Object Model (
TmdlSerializer.SerializeDatabaseToFolder). No TMDL is written by hand, so the layout is exactly what Power BI produces. definition.pbismuses version4.0, the first version that reads the model fromdefinition/instead ofmodel.bim.- Safe overwriting. A non-empty folder is refused unless you pass
--force. With--force, onlydefinition.pbismanddefinition/are replaced, so Desktop’s own files (.pbi/,diagramLayout.json,.platform) survive, and you can re-export into a project that Power BI created. - TMSL projects are never switched. A folder that stores its model as
model.bimis refused even with--force. - Same reporting as before. Anything that can’t be converted faithfully is reported on stderr, and
--strictturns it into a non-zero exit.
Try it yourself: from YAML to Power BI, step by step
In this walkthrough you build a tiny sales model as Apache Ossie YAML, export it as a Power BI project, open it in Power BI Desktop, change it, and watch the change show up in Git. Everything runs offline: the sample data is embedded in the model, so you don’t need a database.
The model has two tables (Product and Sales), one relationship and four metrics.
What you need
- Windows 10 or 11 with Power BI Desktop
- Git
- uv, the Python package manager, which also installs a suitable Python for you:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" - The .NET 8 SDK, because the converter uses Microsoft’s Tabular Object Model (TOM) to write TMDL:
winget install Microsoft.DotNet.SDK.8
Step 1: Get the converter
Clone the repository and install the converter with its optional TOM support:
git clone https://github.com/apache/ossie-converters.gitcd ossie-converters\microsoftuv sync --extra tomuv run python scripts/restore_tom.py
uv sync installs the converter. restore_tom.py downloads Microsoft’s Microsoft.AnalysisServices libraries from NuGet into a local .tom folder. They are Microsoft-licensed, so they are never committed to the repository.

Step 2: Describe the model in YAML
Create a tutorial folder inside ossie-converters\microsoft, and save this as tutorial\contoso_sales.yaml:
version: 0.3.0.dev0name: contoso_salesdescription: A tiny sales model for trying the Power BI project export.datasets: - name: Product source: Product primary_key: [ProductKey] fields: - name: ProductKey datatype: Integer expression: nonportable_dialects: - dialect: ANSI_SQL expression: ProductKey - name: Product datatype: String expression: nonportable_dialects: - dialect: ANSI_SQL expression: Product - name: Category datatype: String expression: nonportable_dialects: - dialect: ANSI_SQL expression: Category # Demo data, so Power BI Desktop can load the model without a database. nonportable_extensions: - vendor_name: POWER_BI data: partitions: - name: Product mode: import source: type: m expression: |- let Source = #table( type table [ProductKey = Int64.Type, Product = text, Category = text], { {1, "Road Bike", "Bikes"}, {2, "Mountain Bike", "Bikes"}, {3, "Helmet", "Accessories"}, {4, "Water Bottle", "Accessories"} } ) in Source - name: Sales source: Sales fields: - name: OrderID datatype: Integer expression: nonportable_dialects: - dialect: ANSI_SQL expression: OrderID - name: OrderDate datatype: Date expression: nonportable_dialects: - dialect: ANSI_SQL expression: OrderDate - name: ProductKey datatype: Integer expression: nonportable_dialects: - dialect: ANSI_SQL expression: ProductKey - name: Quantity datatype: Integer expression: nonportable_dialects: - dialect: ANSI_SQL expression: Quantity - name: Amount datatype: Float expression: nonportable_dialects: - dialect: ANSI_SQL expression: Amount nonportable_extensions: - vendor_name: POWER_BI data: partitions: - name: Sales mode: import source: type: m expression: |- let Source = #table( type table [OrderID = Int64.Type, OrderDate = date, ProductKey = Int64.Type, Quantity = Int64.Type, Amount = number], { {1001, #date(2026, 1, 5), 1, 1, 1200}, {1002, #date(2026, 1, 9), 3, 2, 90}, {1003, #date(2026, 2, 14), 2, 1, 950}, {1004, #date(2026, 2, 20), 4, 5, 50}, {1005, #date(2026, 3, 2), 1, 2, 2400}, {1006, #date(2026, 3, 18), 3, 1, 45} } ) in Sourcerelationships: - name: sales_to_product from: Sales to: Product from_columns: [ProductKey] to_columns: [ProductKey]metrics: - name: Total Sales expression: nonportable_dialects: - dialect: ANSI_SQL expression: SUM(Amount) # Power BI keeps measures on a table; this puts them on Sales. nonportable_extensions: - vendor_name: POWER_BI data: {table: Sales} - name: Total Quantity expression: nonportable_dialects: - dialect: ANSI_SQL expression: SUM(Quantity) nonportable_extensions: - vendor_name: POWER_BI data: {table: Sales} - name: Order Count expression: nonportable_dialects: - dialect: ANSI_SQL expression: COUNT(OrderID) nonportable_extensions: - vendor_name: POWER_BI data: {table: Sales} - name: Average Order Value expression: nonportable_dialects: - dialect: DAX expression: DIVIDE([Total Sales], [Order Count]) nonportable_extensions: - vendor_name: POWER_BI data: {table: Sales}
How to read it:
datasets,fields,relationshipsandmetricsare plain, vendor-neutral Apache Ossie. Any Ossie tool can read them.- Three metrics are written in SQL (
SUM(Amount)). The converter translates them to DAX for you.Average Order Valueis written in DAX, to show that a metric can carry the dialect a tool needs. - The
nonportable_extensionsblocks with vendorPOWER_BIare extras that only Power BI uses. Here they embed the demo data as Power Query#tableexpressions, and they tell Power BI to put the measures on theSalestable. Remove them and the file is still a valid Ossie model; you’d just need a real data source. - Each
expressionlists its forms undernonportable_dialects, one entry per SQL or DAX dialect. Documents written for earlier versions of the spec call this listdialects; current versions of Apache Ossie and the converter need the new name.
Step 3: Export it as a Power BI semantic model
uv run ossie-microsoft export --strict -i tutorial/contoso_sales.yaml --pbip tutorial/out

The folder name comes from the model’s name, so the result lands in tutorial\out\contoso_sales.SemanticModel.
Step 4: Look inside
tree /F tutorial\out

Open tables\Sales.tmdl in any editor. The SQL metrics are now DAX measures, and the original SQL is kept as annotations, so it isn’t lost:
![Sales.tmdl showing measure Total Sales = SUM('Sales'[Amount]) with annotations](https://developershome.blog/wp-content/uploads/2026/11/ossie-pbip-05-sales-tmdl.png?w=1024)
Step 5: Open it in Power BI Desktop
A .pbip project also needs a report, and the export only writes the semantic model. The easiest way is to let Power BI Desktop create an empty project, then export into it.
1. Create an empty project. Open Power BI Desktop with a blank report and choose File > Save as. Set the file type to Power BI project files (*.pbip) and save it as ContosoSales.pbip in your tutorial folder. In older versions of Desktop, first turn on Power BI Project (.pbip) save option and Store semantic model using TMDL format under File > Options and settings > Options > Preview features.

2. Close Power BI Desktop. Desktop holds the project open and would write its own model back when you save.
3. Export into the project’s semantic model folder. Point --pbip at the .SemanticModel folder Desktop created. The first try is refused, because the folder isn’t empty. --force replaces only the model definition:
uv run ossie-microsoft export --strict -i tutorial/contoso_sales.yaml --pbip tutorial/ContosoSales.SemanticModel --force

4. Open tutorial\ContosoSales.pbip. If Desktop says the data needs to be refreshed, click Refresh.

Add a Table visual with Category, Total Sales, Order Count, Total Quantity and Average Order Value. You should see:
| Category | Total Sales | Order Count | Total Quantity | Average Order Value |
|---|---|---|---|---|
| Accessories | 185.00 | 3 | 8 | 61.67 |
| Bikes | 4,550.00 | 3 | 4 | 1,516.67 |
| Total | 4,735.00 | 6 | 12 | 789.17 |

Step 6: Change the model and see it in Git
This is why the PBIP format matters: the model is plain text, so Git can show exactly what changed. Close Power BI Desktop, then save the current version in Git (a separate repository, just for this demo):
git init tutorialgit -C tutorial add ContosoSales.SemanticModel
Now add a fifth metric at the end of tutorial\contoso_sales.yaml:
- name: Largest Sale
expression:
nonportable_dialects:
- dialect: ANSI_SQL
expression: MAX(Amount)
nonportable_extensions:
- vendor_name: POWER_BI
data: {table: Sales}
Export again with --force and look at the diff:
uv run ossie-microsoft export --strict -i tutorial/contoso_sales.yaml --pbip tutorial/ContosoSales.SemanticModel --forcegit -C tutorial diff --statgit -C tutorial diff

Open ContosoSales.pbip again: the new Largest Sale measure is there and returns 2,400 overall (90 for Accessories).

Step 7: Bring it back to YAML
The converter also works the other way. Import the project, and ask it to translate the DAX measures back to SQL where the translation is exact:
uv run ossie-microsoft import -i tutorial/ContosoSales.pbip --translate-dax -o tutorial/roundtrip.yaml
![roundtrip.yaml in an editor: metric Total Sales has two nonportable_dialects, OSSIE_SQL_2026 SUM(Sales.Amount) and DAX SUM('Sales'[Amount])](https://developershome.blog/wp-content/uploads/2026/12/ossie-pbip-08-roundtrip-v2.png?w=969)
The import reads the .pbip, follows it to the semantic model, and writes an Ossie document that other tools, such as the Snowflake, Databricks or dbt converters, can work with.
If something goes wrong
TOM assemblies are unavailable: runuv run python scripts/restore_tom.pyagain from themicrosoftfolder, and check thatdotnet --versionshows 8 or later.stores its model as TMSL (model.bim): your Desktop project saved its model asmodel.bim. Turn on Store semantic model using TMDL format in Desktop, then save the project again, or deletemodel.bimfrom the.SemanticModelfolder.already exists and is not empty: add--forceto replace the model definition. Onlydefinition.pbismanddefinition/are replaced.An Application Control policy has blocked this file: Windows (Smart App Control or a company policy) blocked the small, unsignedossie-microsoft.exelauncher thatuvcreates. Run the converter through Python instead: replaceuv run ossie-microsoftwithuv run python -m ossie_microsoft.cliin every command, for exampleuv run python -m ossie_microsoft.cli export --strict -i tutorial/contoso_sales.yaml --pbip tutorial/out.metric has no expression; skipped: the YAML uses the olddialectskey. Apache Ossie renamed the list of an expression fromdialectstononportable_dialects, so renamedialects:tononportable_dialects:under everyexpression.- Desktop still shows the old model: close Desktop completely before exporting, then reopen the
.pbip.
What’s next
- Microsoft just announced semantic views in Fabric, the first Fabric feature built on Apache Ossie. A PBIP export gives you a full, editable Power BI model for Git and CI/CD, while a semantic view is a lightweight, read-only layer on a lakehouse. They work well together, and a Fabric semantic view export target could be a good next step for the converter.
If you work with Power BI and semantic models, give the converter a try and open an issue with what you find.
Links
- PR #76: https://github.com/apache/ossie-converters/pull/76
- Issue #75: https://github.com/apache/ossie-converters/issues/75
- Apache Ossie converters: https://github.com/apache/ossie-converters
- Apache Ossie spec: https://github.com/apache/ossie
- Power BI project semantic model folder: https://learn.microsoft.com/en-us/power-bi/developer/projects/projects-dataset
![From Apache Ossie to a Power BI project: an Apache Ossie YAML metric, Total Sales with SUM(Amount), becomes the DAX measure SUM('Sales'[Amount]) in a TMDL file](https://developershome.blog/wp-content/uploads/2026/12/ossie-pbip-cover-3x2-1.png?w=1024)
Leave a Reply