Creating new tables with TMDL scripts causes "unsupported partition" error
After the May release of Power BI Desktop, it's no longer possible to create a new table using TMDL script if the table contains any M partition. Even the default partition results in an error:
[error] Model validation failed. The following tables contain unsupported partitions: Brands (Partition Type: M)
Earlier, it was possible to create new tables with a default partition. See the sample TMDL script below
createOrReplace
table Brands
column Class
dataType: string
summarizeBy: none
sourceColumn: Class
annotation SummarizationSetBy = Automatic
column Brand
dataType: string
summarizeBy: none
sourceColumn: Brand
annotation SummarizationSetBy = Automatic
column 'Sub Brand'
dataType: string
summarizeBy: none
sourceColumn: Sub Brand
annotation SummarizationSetBy = Automatic
partition Brands = m
mode: import
source =
let
Source = Sql.Database(#"SqlEndpoint", #"Database"), Data = Source{[Schema = "Dimview", Item = "Brands"]}[Data]
in
Data
annotation PBI_NavigationStepName = Navigation
annotation PBI_ResultType = Table
Update: The script only results in an error if the data model is empty and doesn't have any other tables added to it. I added another table and tried the script again, and it worked. In Summary, you can't add a table in an empty data model using TMDL scripts. For the script to work, at least one other table must be present in the data model.