flowto.sh
BI Team · tmdl
json ndjson tmdl power-automate

Power BI TMDL Table & Import Partition

Tabular Model Definition Language (TMDL) script defining a Product table, hidden surrogate key column, and an M-powered Import mode partition.

Open Power BI Inspector
powerbi-tmdl-partitions (text)
createOrReplace

	ref table Product
		column ProductKey
			dataType: int64
			isHidden: true
			sourceColumn: ProductKey

		column ProductName
			dataType: string
			sourceColumn: ProductName

		partition Product-partition = m
			mode: import
			source =
				let
					Source = Sql.Database("myServer", "myDatabase"),
					dbo_Product = Source{[Schema="dbo",Item="Product"]}[Data],
					#"Renamed Columns" = Table.RenameColumns(dbo_Product,{{"Name", "ProductName"}})
				in
					#"Renamed Columns"

Use this TMDL pattern alongside /pbix to audit mode: import partitions and Power Query M let ... in transformations.