Microsoft Fabric Semantic Views: Tutorial, YAML, Relationships & Semantic Models
Create a reusable business definition beside your Lakehouse tables, publish a Direct Lake semantic model, and use the same revenue metric in Power BI and Fabric data agents. This walkthrough shows exactly where each file belongs, how to create relationships, and what the preview cannot do.
A semantic view is a set of YAML definitions for datasets, relationships and DAX-based metrics, stored under Context/Semantic Views/<name>/ in a Fabric Lakehouse. When you publish, Fabric compiles read-only output in SystemContext and creates a read-only Direct Lake on OneLake semantic model. Reports and agents query that model—not the YAML directly. Semantic views complement, rather than replace, ordinary Power BI semantic models.
What is a semantic view—and why did Microsoft create it?
Teams often calculate the same metric in multiple places. A report can define revenue one way, a data agent can use a different expression, and another Lakehouse can store a separate set of business definitions. A semantic view lets you maintain a portable, human-readable set of definitions alongside OneLake data, and reuse those definitions without copying the underlying tables.
It is not a SQL view, materialized view, data transformation engine, or new replacement for the Power BI semantic model. The YAML stores meaning: table aliases, relationship paths, measure expressions and descriptions. Publishing translates the supported definitions into a generated semantic model, which executes DAX queries through Direct Lake.
At this preview stage, not every capability in the underlying Apache Ossie format is compiled into Fabric. DAX is required for published metrics and broader Power BI modeling features remain better suited to a directly authored model.
Where are Context, SystemContext and the semantic model?
The part that confuses many first-time users is seeing two folders. They do different jobs. Context is the editable source of truth; SystemContext is the generated representation. The separate workspace semantic model is the object Power BI and agents connect to.
| Location | What belongs there | What to edit |
|---|---|---|
Tables/dbo/ | Delta tables containing the actual source rows | Source data through approved data-engineering processes |
Context/Semantic Views/sales/ | schema.yaml, metrics.yaml and other supported definitions | These YAML files, then Publish |
SystemContext/Semantic Views/sales/ | Generated, read-only Tabular Model Definition Language (TMDL) | Never edit; inspect for generated output |
Workspace item named sales | Read-only Direct Lake on OneLake semantic model | Consume in reports/agents; change YAML to update |
Where do you create relationships? In the semantic view YAML, under relationships. They appear in the generated model after publishing. Don’t create them by editing the generated model diagram; that diagram is for inspection.
Advertisements
Build a semantic view using Microsoft’s sample sales data
The following example follows the official Fabric sample so you can verify actual expected answers. It uses a schema-enabled Lakehouse and three small tables. The sample has six sales, three stores and three products—not a fictitious schema you have to guess.
Prepare the data in a separate Lakehouse
- Create a test Lakehouse named
lakehouse_saleswith schemas enabled, in an eligible Fabric workspace. - Download Microsoft’s Fabric sample files using the specific links in the official semantic views tutorial:
FactSales.csv,DimStore.csv, andDimProducts.csv. - Inside Lakehouse Files, create
semantic-view-samplesand upload the files. - For each, select Load to tables → New table, choose the
dboschema, select Column header, and createfactsales,dimstore, anddimproducts. - Confirm counts of 6, 3 and 3 respectively, and that revenue and units are numeric before continuing.
These are Microsoft tutorial sample files. A CSV preview is not the same as a successfully created Delta table; verify under Tables → dbo.
Create the view from the Lakehouse—not the SQL endpoint tab
Open the Lakehouse view and select New semantic view on the ribbon. Enter sales. Fabric creates Context/Semantic Views/sales/ with a starter sales_semantic_view.yaml. Rename it to schema.yaml and replace the starter text with the model definition below. If you upload complete files instead, remove incomplete starter examples so all published YAML is consistent.
Define the datasets and relationships in YAML
There are three dataset aliases here. sales maps to dbo.factsales; stores maps to dbo.dimstore; and products maps to dbo.dimproducts. DAX and relationships refer to the aliases, not the underlying schema-qualified names.
version: 0.2.0.dev0
name: sales
description: Sales definitions for reporting and agents.
datasets:
- name: sales
source: dbo.factsales
description: One row per sale line.
- name: stores
source: dbo.dimstore
description: Store and region attributes.
- name: products
source: dbo.dimproducts
description: Product and category attributes.
relationships:
- name: sales_to_stores
from: sales
to: stores
from_columns:
- StoreId
to_columns:
- StoreId
- name: sales_to_products
from: sales
to: products
from_columns:
- ProductId
to_columns:
- ProductIdEach relationship declares the many-side dataset in from and the unique-key dimension in to. This preview supports a single column per relationship and active, unambiguous paths. Check that StoreId and ProductId are unique on the dimension side. Fabric does not invent the business relationships for you.
The name property is required in each YAML file, but Fabric uses the view folder’s name for the generated model, not this property. The description in the file becomes a description in the generated model.
Advertisements
Add DAX metrics and publish the view
Create a second file named metrics.yaml in the same view folder. Each metric needs a DAX expression using the YAML dataset aliases, such as 'sales'[RevenueUSD]. These metrics become measures in a generated Metrics table.
version: 0.2.0.dev0
name: sales
metrics:
- name: Total Revenue
description: Sales revenue in US dollars.
expression:
dialects:
- dialect: DAX
expression: "SUM('sales'[RevenueUSD])"
- name: Sale Count
description: Number of unique sales.
expression:
dialects:
- dialect: DAX
expression: "DISTINCTCOUNT('sales'[SaleId])"
- name: Units Sold
description: Total units sold.
expression:
dialects:
- dialect: DAX
expression: "SUM('sales'[Units])"Save both files, then right-click the sales view folder under Context and choose Publish. Saving files alone does not rebuild the semantic model. Publishing merges the view’s YAML, validates the supported constructs and creates or updates the sales semantic model in the workspace.
To inspect the result, expand SystemContext → Semantic Views, right-click sales, and choose Open in model view. You should find three tables, two relationships and a Metrics table. You need inherited model Write permission to open this inspection view, but the generated model itself remains read-only.
Run a DAX test and compare expected results
On the generated view folder choose Validate in DQV and run:
EVALUATE
SUMMARIZECOLUMNS(
'stores'[Region],
"Revenue", [Total Revenue],
"Sales", [Sale Count],
"Units", [Units Sold]
)
ORDER BY 'stores'[Region]| Region | Revenue (USD) | Sales | Units |
|---|---|---|---|
| France | 302 | 2 | 56 |
| Germany | 290 | 2 | 53 |
| Netherlands | 263 | 2 | 49 |
| Total | 855 | 6 | 158 |
These numbers come from Microsoft’s sample. If you get different values, check input types, table counts and relationship key mapping—not just the measure expression. Try a second query grouped by 'products'[Category]; the official sample returns Ice Cream revenue 747 and Sorbet revenue 108.
Update one business definition safely
Add the following metric beneath the existing metrics entries and publish again. The expected unfiltered result is 142.5, calculated as $855 divided by six sales.
- name: Average Revenue per Sale
description: Revenue divided by number of sales.
expression:
dialects:
- dialect: DAX
expression: "DIVIDE([Total Revenue], [Sale Count])"Republish after any metric update and rerun the DAX validation. Consumers using the generated model can then access the new measure. Check downstream report compatibility before renaming or removing existing metric names.
Use the published definitions in Power BI and Fabric data agents
Power BI report
In Power BI Desktop or the Fabric portal, create a report using an existing semantic model and connect to sales. Use the region dimension and Total Revenue measure in a visual. Desktop supports Connect to this generated model, not remote Edit.
Fabric data agent
Open your data agent, select Add data source, and choose the generated sales semantic model. Test a question such as “What is total revenue by region?” and compare its numeric answer to the DAX table.
Semantic view vs Power BI semantic model: which should you choose?
| Question | Semantic view (preview) | Directly authored semantic model |
|---|---|---|
| Where does authoring happen? | YAML definition beside Lakehouse data in Context | Power BI / Fabric modeling interfaces and supported tools |
| What executes DAX? | Generated read-only Direct Lake on OneLake model | The authored model itself |
| Can I reuse logic across Lakehouses? | Yes, selected definitions through OneLake shortcuts, then local publish | Model reuse follows semantic-model sharing and connection approaches |
| Can I edit generated measures in Desktop? | No; change YAML and publish | Supported through normal model authoring paths |
| Storage-mode/source flexibility? | Lakehouse-backed Direct Lake on OneLake in preview | Wider supported options such as Import and DirectQuery |
| Advanced features? | Limited preview syntax; no XMLA on generated model | Choose direct authoring for calculation groups, broader modeling and XMLA tooling where supported |
| Git/deployment pipelines? | Not supported for semantic views or their generated models in preview | Supported scenarios depend on the model and workspace configuration |
When the semantic view is useful: you want a lightweight, lakehouse-local, portable business definition, shared across analytics teams or agents. When an ordinary semantic model is better: you need sophisticated BI features, a broader data-source choice, existing XMLA/TMDL editing workflows, or established CI/CD deployment processes.
For deeper reading, see our Power BI calculation groups, row-level security, and Fabric vs Power BI guides.
Troubleshoot your semantic view
Choose the symptom you see. This local selector is a guide to the likely next check; it does not connect to your Fabric tenant or alter any settings.
Common failure patterns
Publish says the table or column does not exist
Verify the Lakehouse is schema enabled and the source table is in the declared schema. For example, source: dbo.factsales must be a real Lakehouse table. Relationships reference dataset aliases and exact column names, not a SQL query or a report field alias.
Metrics are missing after publish
Each published metric needs a nonempty DAX dialect expression. A metric specified only in ANSI SQL can be omitted with a warning. Check the publish report, not only whether the command completed. The ai_context and custom extension properties are not mapped into the generated model in this preview.
A YAML file was ignored
Only files ending in .yaml are included. Files ending in .yml are ignored without warning. A semantic view supports up to 20 YAML files, 16 MB combined definition size and 30 MB generated TMDL.
The generated model has different names or filters
The folder name becomes the generated model name. Dataset name becomes the model table alias. The dimension key on the one side must be unique; only single-column relationships are supported and ambiguous paths should be avoided.
A user can see model metadata but not data
Model Read/Build access and OneLake underlying table access are distinct checks. Lakehouse Read grants generated-model Read and Build, but querying requires the applicable data access. Also note that Context doesn’t support OneLake security; avoid publishing sensitive business definitions or secrets into shared YAML.
Deleting or renaming a view broke reports
Deleting YAML does not automatically remove the generated model. Renames don’t synchronize source folders and the generated model. Restoring a deleted model by republishing creates a new model and won’t restore old report connections. Coordinate deletions and follow Microsoft’s cleanup steps.
Preview limits, security and costs to know before production
- Scope: Lakehouse only, supported YAML constructs and DAX metrics. The format is based on Apache Ossie, but not every Ossie property is applied by Fabric.
- CI/CD: no Git integration or deployment pipelines for semantic views and generated models in this preview. Avoid using a workspace connected to these lifecycle features for the tutorial.
- Model editing: generated model is read-only; XMLA access (including read-only), Desktop remote editing and ontology creation from it are unsupported.
- Security: check Lakehouse permissions, underlying OneLake data roles, and OLS metadata warnings. Source definitions in Context should not contain secrets or sensitive information.
- Publishing: be mindful of name conflicts, simultaneous publishers and incomplete YAML files. Publishing doesn’t lock files while reading them.
- Costs: no separate semantic-view meter. Definition files use OneLake storage; generated Direct Lake model queries consume existing query meters.
The model inherits Lakehouse permissions, but a generated model should still be tested with the actual user permissions that will access reports or agents. Treat this as a preview pilot until your governance, access and release controls satisfy the documented limitations.
Video walkthroughs and visual references
These English-language videos explain related semantic-model and Fabric IQ ideas. They do not demonstrate the newly released semantic-view YAML publishing workflow. For the exact steps, use the illustrated tutorial above and Microsoft’s live documentation.
Fabric Insider: the evolution of semantic models

RADACAD discussion with a Microsoft Power BI product leader about the semantic layer and AI. Background concepts, not an exact November semantic-view tutorial.
Watch on YouTubeCreate a regular Fabric semantic model

Pragmatic Works demonstrates standard semantic-model relationships and reporting, useful for comparing the new YAML view with direct model authoring.
Watch on YouTubeFor actual portal screenshots of the released semantic-view experience, use Microsoft’s illustrated tutorial. The diagrams in this article are original explanatory illustrations, not copied interface screenshots.
Frequently asked questions
Where do I create relationships in Fabric Semantic Views?
Create them under relationships in your view’s YAML files under Context/Semantic Views/<view>/. Publish the view to generate the model relationships. The model view under SystemContext is for inspection, not editing.
Is a semantic view the same as a semantic model?
No. The semantic view is the reusable definition. Publishing generates a read-only Direct Lake on OneLake semantic model that reports and agents query. Regular semantic models provide much broader authoring capabilities.
Can I use a semantic view in Power BI Desktop?
Yes. Connect to the generated semantic model for report authoring. Editing the generated model directly from Desktop isn’t supported in this preview.
Can semantic views reuse definitions across Lakehouses?
Yes, using OneLake shortcuts to the view definition folders or subfolders. Referenced tables must exist in the consuming Lakehouse, which must publish its own view and model.
Does Semantic Views replace calculation groups or TMDL?
No. The current preview does not provide complete Power BI semantic-model authoring. Use a directly authored model for advanced features and existing XMLA tooling. The generated output is TMDL but is read-only.
Do I need to pay for semantic views separately?
No dedicated semantic-view meter is documented. OneLake file storage and Direct Lake model queries consume their existing Fabric resources and meters.
Official documentation and next steps
This article is based on Microsoft documentation reviewed on 24 November 2026. The YAML and DAX follow Microsoft’s published sample and expected results, but haven’t been executed in a live customer Fabric tenant for this article. Verify the current preview status before a production decision.
- Microsoft Semantic Views overview, permissions and limitations
- Official sample-data tutorial and expected results
- Create and organize YAML definitions
- YAML syntax and supported constructs
- Connect reports, agents and other Lakehouses