Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

How to: Add Table with Tabular Editor with ObjectType "Dual" and Source "M"

Hi all, 

 

I started to work with tabular editor and if I open one of our existing Power BI Models the table properties are set like this: 

TableSettingsTableSettings

The partition properties look like this: 

PartitionSettingsPartitionSettings

Now I have the need to rebuild such a configuration from scratch. So I did the following scripting in a new created model with tabular editor 2: 

Model.AddTable("Test2").AddMPartition();

 The partition created looks fine after changing the mode to "dual" manually:

PartitionFromScratchPartitionFromScratch

But the table does not have the intended properties and I can not change them manually:

TableFromScratchTableFromScratch

This seems to happen because a standard partition is also created from the script. After deleting this second partition it also looks good. 

 

Now my questions: 

How can I code the script in a way, that my properties will be set in the right way from scratch?

I did some investigation on TOM and Tabular Editor 2. And tried some syntax. But it did not worked out.

Maybe someone can show me the link to the Appendix A mentioned here:  Advanced Scripting | Tabular Editor Documentation

and give me some hints, how the syntax is working. I even do not find out how to delete the automatically created - but not needed - default partition using a script. 

 

Best regards

Thias

 

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please see if these documents are helpful:

 

Create Tables, Partitions, and Columns in a Tabular model 

Model Class 

 

 

Best Regards,
Winniz

Anonymous
Not applicable

Hi @v-kkf-msft ,

 

sorry I tried different variations looking like this: 

Thias_0-1633438224002.png

 

but I get only error. I am using tabular editor and opening up a new model. I want to script the model without any database connection. This is going to be implemented as an m-code in the partitions of the created tables. Therefore the example given here, seem not to fit: Create Tables, Partitions, and Columns in a Tabular model 

Actualy, I think it is my fault, because I know nothing about C# and do not know were to start at least. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.