Semantic link in Fabric notebooks: Python that respects the golden model
Data science will rebuild revenue in pandas. They will be almost right. Finance will notice. Semantic link (sempy) lets a Fabric notebook read from the semantic model โ measures, DAX, and often the same security context โ instead of from a private CSV extract.
When to use it
- Notebook needs the same KPI the exec report shows
- You want a what-if or allocation in Python, then write results to a Gold table the model can read back
- QA: compare notebook output to
EVALUATEof a measure
When not to
- Heavy feature engineering on Bronze grain โ go to Spark tables
- You were about to
to_pandas()a 200M-row fact “just to groupby”
Guardrails
- Point at the certified model in the Test or Prod workspace you intend, not a personal copy
- Treat DAX executed from Python as production logic. PR it. Do not hide 40-line queries in an unmarked cell
- Respect RLS: run as a service identity that is supposed to see the data, or document that the notebook is elevated
- Do not write back into the semantic model as a side channel. Write tables, refresh the model
Minimal pattern
import sempy.fabric as fabric- List datasets / read a table or execute DAX against the golden model
- Assert row counts and a checksum measure (e.g.
Total Revenue) before downstream writes
This is how Python jobs stop being a second BI stack.
Want a semantic-link QA notebook on your certified revenue model? Book a 30-minute call.