Table of Contents

Class Table

Inheritance
Table
Implements
Derived
Inherited Members
Namespace
TabularEditor.TOMWrapper
Assembly
TOMWrapper.dll

Represents a Table in the data model. A Table object is a member of the TableCollection object under a Model object. It contains a ColumnCollection. Rows are based on Partition object or a TabularEditor.TOMWrapper.CalculatedPartitionSource if the Table is a calculated table.

public class Table : TabularNamedObject, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, IDescriptionObject, ILineageTagObject, IExtendedPropertyObject, ITabularPerspectiveObject, IHideableObject, ITranslatableObject, IAnnotationObject, ISynonymObject, IClonableObject, ITabularObjectContainer, IDaxObject, IDaxDependantObject, IExpressionObject, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, INamedObject, ITomErrorMessageObject
Extension Methods

Properties

AllLevels

Enumerates all levels across all hierarchies on this table.

[Browsable(false)]
public IEnumerable<Level> AllLevels { get; }

Property Value

Type Description
IEnumerable<Level>

AlternateSourcePrecedence

The ranking or precedence used to select the alternate source table in case more than one match is found.

public int AlternateSourcePrecedence { get; set; }

Property Value

Type Description
int

Remarks

This property is only supported when the compatibility level of the database is at 1460 or above.

Annotations

The collection of Annotations on the current Table.

[Browsable(true)]
public AnnotationCollection Annotations { get; }

Property Value

Type Description
AnnotationCollection

CalculatedColumns

Enumerates only the calculated columns on this table.

[Browsable(false)]
public IEnumerable<CalculatedColumn> CalculatedColumns { get; }

Property Value

Type Description
IEnumerable<CalculatedColumn>

Columns

The collection of Column objects on this Table.

[Browsable(false)]
public ColumnCollection Columns { get; protected set; }

Property Value

Type Description
ColumnCollection

DataCategory

Specifies the type of Table so that you can customize application behavior based on the type of data in the table. Allowed values are identical to those of dimension type properties for Multidimensional models. Regular is the default. Other values include Time (2), Geography (3), Organization (4), BillOfMaterials (5), Accounts (6), Customers (7), Products (8), Scenario (9), Quantitativ1e (10), Utility (11), Currency (12), Rates (13), Channel (14) - channel dimension, Promotion (15).

[TypeConverter(typeof(TableDataCategoryConverter))]
public string DataCategory { get; set; }

Property Value

Type Description
string

DataColumns

Enumerates only the data columns on this table.

[Browsable(false)]
public IEnumerable<DataColumn> DataColumns { get; }

Property Value

Type Description
IEnumerable<DataColumn>

DaxObjectFullName

Gets a string that may be used for referencing the table in a DAX expression.

[Browsable(true)]
public string DaxObjectFullName { get; }

Property Value

Type Description
string

DaxObjectName

Gets a string that may be used for referencing the table in a DAX expression.

[Browsable(false)]
public string DaxObjectName { get; }

Property Value

Type Description
string

DaxTableName

Gets a string that may be used for referencing the table in a DAX expression.

[Browsable(false)]
public string DaxTableName { get; }

Property Value

Type Description
string

DefaultDetailRowsExpression

A DAX expression specifying default detail rows for this table (drill-through in client tools).

public string DefaultDetailRowsExpression { get; set; }

Property Value

Type Description
string

DefaultExpressionProperty

Gets the default expression property on the current object.

[Browsable(false)]
public virtual ExpressionProperty? DefaultExpressionProperty { get; }

Property Value

Type Description
ExpressionProperty?

DependsOn

Gets the list of objects that this table depends on based on its DAX expression.

[Browsable(false)]
public DependsOnList DependsOn { get; }

Property Value

Type Description
DependsOnList

Description

The description of the table, visible to developers at design time and to administrators in management tools, such as SQL Server Management Studio.

public string Description { get; set; }

Property Value

Type Description
string

EnableRefreshPolicy

Enable or disable incremental refresh policy for this table

public bool EnableRefreshPolicy { get; set; }

Property Value

Type Description
bool

ErrorMessage

Gets the error message currently reported on this table.

public virtual string ErrorMessage { get; }

Property Value

Type Description
string

ExcludeFromAutomaticAggregations

An indication whether the table is excluded from the automatic aggregations feature.

public bool ExcludeFromAutomaticAggregations { get; set; }

Property Value

Type Description
bool

Remarks

This property is only supported when the compatibility level of the database is at 1572 or above.

ExcludeFromModelRefresh

A boolean value that indicates whether the table is excluded from model refresh. When this is true, a refresh operation on the model would not trigger a refresh on the partitions of the table if they were already processed.

public bool ExcludeFromModelRefresh { get; set; }

Property Value

Type Description
bool

Remarks

This property is only supported when the compatibility level of the database is at 1480 or above.

ExtendedProperties

The collection of Extended Properties on the current Table.

public ExtendedPropertyCollection ExtendedProperties { get; }

Property Value

Type Description
ExtendedPropertyCollection

Hierarchies

The collection of Hierarchy objects on this Table.

[Browsable(false)]
public HierarchyCollection Hierarchies { get; protected set; }

Property Value

Type Description
HierarchyCollection

InPerspective

[Browsable(true)]
public PerspectiveTableIndexer InPerspective { get; }

Property Value

Type Description
PerspectiveTableIndexer

IncrementalGranularity

Granularity of the (most recent) incremental refresh range

[Browsable(false)]
public RefreshGranularityType IncrementalGranularity { get; set; }

Property Value

Type Description
RefreshGranularityType

IncrementalPeriods

Number of periods for the incremental refresh range

[Browsable(false)]
public int IncrementalPeriods { get; set; }

Property Value

Type Description
int

IncrementalPeriodsOffset

Lag or leading periods from Now() to the rolling window head

[Browsable(false)]
public int IncrementalPeriodsOffset { get; set; }

Property Value

Type Description
int

IsHidden

A boolean value that indicates whether the table is treated as hidden by client visualization tools. True if the Table is treated as hidden; otherwise false.

public bool IsHidden { get; set; }

Property Value

Type Description
bool

IsPrivate

A boolean value that specifies whether to hide a table from the client. True hides the tables.

public bool IsPrivate { get; set; }

Property Value

Type Description
bool

Remarks

This property is only supported for Pbi server, at database compatibility level of 1400 or above for Box server, at database compatibility level of 1400 or above for Excel server.

IsVisible

Gets whether the table is visible to end users. This is the case if the table contains visible measures.

[Browsable(false)]
public bool IsVisible { get; }

Property Value

Type Description
bool

LineageTag

A tag that represents the lineage of the object.

public string LineageTag { get; set; }

Property Value

Type Description
string

Remarks

This property is only supported when the compatibility level of the database is at 1540 or above.

Measures

The collection of Measure objects on this Table.

[Browsable(false)]
public MeasureCollection Measures { get; protected set; }

Property Value

Type Description
MeasureCollection

Mode

Defines the mode of a refresh policy applied during incremental refresh.

[Browsable(false)]
public RefreshPolicyMode Mode { get; set; }

Property Value

Type Description
RefreshPolicyMode

ObjectLevelSecurity

Provides a convenient way to get or set the Object-Level permissions assigned to this table across different roles.

public TableOLSIndexer ObjectLevelSecurity { get; set; }

Property Value

Type Description
TableOLSIndexer

Parent

The parent Model of the current Table.

public Model Parent { get; }

Property Value

Type Description
Model

Partitions

The collection of Partition objects on this Table.

public PartitionCollection Partitions { get; protected set; }

Property Value

Type Description
PartitionCollection

PolicyType

Specifies the type of the refresh policy

[Browsable(false)]
public RefreshPolicyType PolicyType { get; set; }

Property Value

Type Description
RefreshPolicyType

PollingExpression

If not null, M expression that is evaluated and stored for each partition upon each refresh or merge operation. Result is stored in Partition.RefreshBookmark

[Browsable(false)]
public string PollingExpression { get; set; }

Property Value

Type Description
string

ReferencedBy

Gets the list of objects that reference this table based on their DAX expressions.

[Browsable(false)]
public ReferencedByList ReferencedBy { get; }

Property Value

Type Description
ReferencedByList

RefreshPolicy

Gets or sets the Refresh Policy of the Table.

[TypeConverter(typeof(RefreshPolicyConverter))]
public BasicRefreshPolicy RefreshPolicy { get; set; }

Property Value

Type Description
BasicRefreshPolicy

RelatedTables

Enumerates all tables related to or from this table.

[Browsable(false)]
public IEnumerable<Table> RelatedTables { get; }

Property Value

Type Description
IEnumerable<Table>

RollingWindowGranularity

Target granularity of the rolling window for the whole dataset

[Browsable(false)]
public RefreshGranularityType RollingWindowGranularity { get; set; }

Property Value

Type Description
RefreshGranularityType

RollingWindowPeriods

Number of periods for the rolling window for the whole dataset

[Browsable(false)]
public int RollingWindowPeriods { get; set; }

Property Value

Type Description
int

RowLevelSecurity

Provides a convenient way to access the Row Level Filters assigned to this table across different roles.

[Browsable(true)]
public TableRLSIndexer RowLevelSecurity { get; }

Property Value

Type Description
TableRLSIndexer

Sets

The collection of Set objects on this Table.

public SetCollection Sets { get; protected set; }

Property Value

Type Description
SetCollection

ShowAsVariationsOnly

A boolean value that indicates a difference between a local and server version. If True, the Table is only shown when referenced as Variation.

public bool ShowAsVariationsOnly { get; set; }

Property Value

Type Description
bool

Remarks

This property is only supported for Pbi server, at database compatibility level of 1400 or above for Box server, at database compatibility level of 1400 or above for Excel server.

Source

Gets the name of the data source used by the table.

public string Source { get; }

Property Value

Type Description
string

SourceExpression

M expression that is used as the source M expression for new partitions. It includes the date filter by referring to 2 M parameters named [RangeStart] and [RangeEnd], which can be dates or integers depending on IntegerDateKey below

[Browsable(false)]
public string SourceExpression { get; set; }

Property Value

Type Description
string

SourceLineageTag

A tag that represents the lineage of the source for the object.

public string SourceLineageTag { get; set; }

Property Value

Type Description
string

Remarks

This property is only supported when the compatibility level of the database is at 1550 or above.

SourceType

Gets the type of the data source used by the table.

public PartitionSourceType SourceType { get; }

Property Value

Type Description
PartitionSourceType

Synonyms

Collection of localized synonyms for this Table.

[Browsable(true)]
public SynonymIndexer Synonyms { get; }

Property Value

Type Description
SynonymIndexer

SystemManaged

A boolean value that indicates whether the table is managed by the system. The system takes ownership of creation and deletion of such tables.

public bool SystemManaged { get; set; }

Property Value

Type Description
bool

Remarks

This property is only supported when the compatibility level of the database is at 1562 or above.

TableGroup

Gets or sets the name of the Table Group in which this table is displayed (Tabular Editor only)

[TypeConverter(typeof(TableGroupConverter))]
public string TableGroup { get; set; }

Property Value

Type Description
string

TranslatedDescriptions

Collection of localized descriptions for this Table.

[Browsable(true)]
public TranslationIndexer TranslatedDescriptions { get; }

Property Value

Type Description
TranslationIndexer

TranslatedNames

Collection of localized names for this Table.

[Browsable(true)]
public TranslationIndexer TranslatedNames { get; }

Property Value

Type Description
TranslationIndexer

UsedInRelationships

Enumerates all relationships in which this table participates.

[Browsable(false)]
public IEnumerable<SingleColumnRelationship> UsedInRelationships { get; }

Property Value

Type Description
IEnumerable<SingleColumnRelationship>

Methods

AddCalculatedColumn(string, string, string, IInsertOptions)

Adds a new calculated column to the table and returns a reference to the column.

public CalculatedColumn AddCalculatedColumn(string name = null, string expression = null, string displayFolder = null, IInsertOptions insertOptions = null)

Parameters

Type Name Description
string name

The name of the column

string expression

DAX expression to assign to the column

string displayFolder

Display Folder to assign to the column

IInsertOptions insertOptions

Returns

Type Description
CalculatedColumn

A reference to the newly added column

AddDataColumn(string, string, string, DataType, IInsertOptions)

Adds a new data column to the table and returns a reference to the column.

public DataColumn AddDataColumn(string name = null, string sourceColumn = null, string displayFolder = null, DataType dataType = DataType.String, IInsertOptions insertOptions = null)

Parameters

Type Name Description
string name

The name of the column

string sourceColumn

The name of the column in the source query

string displayFolder

Display Folder to assign to the column

DataType dataType

Data Type to assign to the column

IInsertOptions insertOptions

Returns

Type Description
DataColumn

A reference to the newly added column

AddEntityPartition(string, string)

Adds a new Entity (DQ over AS or DirectLake) partition to the table and returns a reference to the partition.

public EntityPartition AddEntityPartition(string name = null, string entityName = null)

Parameters

Type Name Description
string name

The name of the partition

string entityName

The name of the entity (source table) to assign to the partition.

Returns

Type Description
EntityPartition

A reference to the newly added partition.

AddHierarchy(string, string, params string[])

Adds a new hierarchy to the table and returns a reference to the hierarchy.

public Hierarchy AddHierarchy(string name, string displayFolder, params string[] levels)

Parameters

Type Name Description
string name

Name of the hierarchy.

string displayFolder

Display folder of the hierarchy.

string[] levels

A list of column names to add as levels of the hierarchy

Returns

Type Description
Hierarchy

AddHierarchy(string, string, params Column[])

Adds a new hierarchy to the table and returns a reference to the hierarchy.

public Hierarchy AddHierarchy(string name, string displayFolder, params Column[] levels)

Parameters

Type Name Description
string name

Name of the hierarchy.

string displayFolder

Display folder of the hierarchy.

Column[] levels

A list of column names to add as levels of the hierarchy

Returns

Type Description
Hierarchy

AddHierarchy(string, string, IInsertOptions, params string[])

Adds a new hierarchy to the table and returns a reference to the hierarchy.

public Hierarchy AddHierarchy(string name, string displayFolder, IInsertOptions insertOptions, params string[] levels)

Parameters

Type Name Description
string name

Name of the hierarchy.

string displayFolder

Display folder of the hierarchy.

IInsertOptions insertOptions
string[] levels

A list of column names to add as levels of the hierarchy

Returns

Type Description
Hierarchy

AddHierarchy(string, string, IInsertOptions, params Column[])

Adds a new hierarchy to the table and returns a reference to the hierarchy.

public Hierarchy AddHierarchy(string name = null, string displayFolder = null, IInsertOptions insertOptions = null, params Column[] levels)

Parameters

Type Name Description
string name

Name of the hierarchy.

string displayFolder

Display folder of the hierarchy.

IInsertOptions insertOptions
Column[] levels

A list of columns to add as levels of the hierarchy

Returns

Type Description
Hierarchy

AddMPartition(string, string)

Adds a new M partition to the table and returns a reference to the partition.

public MPartition AddMPartition(string name = null, string expression = null)

Parameters

Type Name Description
string name

The name of the partition

string expression

The M expression to assign to the partition.

Returns

Type Description
MPartition

A reference to the newly added partition.

AddMeasure(string, string, string, IInsertOptions)

Adds a new measure to the table and returns a reference to the measure.

public Measure AddMeasure(string name = null, string expression = null, string displayFolder = null, IInsertOptions insertOptions = null)

Parameters

Type Name Description
string name

Name of the measure

string expression

DAX expression to assign to the measure

string displayFolder

Display Folder to assign to the measure

IInsertOptions insertOptions

Returns

Type Description
Measure

A reference to the newly added measure.

AddPartition(string, string)

Adds a new (legacy) partition to the table and returns a reference to the partition.

public Partition AddPartition(string name = null, string query = null)

Parameters

Type Name Description
string name

The name of the partition

string query

The query expression to assign to the partition.

Returns

Type Description
Partition

A reference to the newly added partition.

AddPolicyRangePartition(string)

Adds a new Policy Range partition to the table and returns a reference to the partition.

public PolicyRangePartition AddPolicyRangePartition(string name = null)

Parameters

Type Name Description
string name

The name of the partition

Returns

Type Description
PolicyRangePartition

A reference to the newly added partition.

AddRefreshPolicy()

Adds a RefreshPolicy to this measure.

public RefreshPolicy AddRefreshPolicy()

Returns

Type Description
RefreshPolicy

ApplyRefreshPolicy()

Update partition definitions based on the current refresh policy with Now() as Effective Date

public void ApplyRefreshPolicy()

ApplyRefreshPolicy(DateTime)

Update partition definitions based on the current refresh policy using the specified Effective Date

public void ApplyRefreshPolicy(DateTime effectiveDate)

Parameters

Type Name Description
DateTime effectiveDate

Effective Date of the refresh policy.

Children_CollectionChanged(object, NotifyCollectionChangedEventArgs)

protected override void Children_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)

Parameters

Type Name Description
object sender
NotifyCollectionChangedEventArgs e

ClearAnnotations()

Removes all annotations from this object.

public void ClearAnnotations()

ClearExtendedProperties()

Removes all Extended Properties from this object.

public void ClearExtendedProperties()

Clone(string, bool)

Creates an exact copy of this Table object.

public virtual Table Clone(string newName = null, bool includeTranslations = true)

Parameters

Type Name Description
string newName
bool includeTranslations

Returns

Type Description
Table

CreateNew(Model, string)

Creates a new Table and adds it to the parent Model. Also creates the underlying metadataobject and adds it to the TOM tree.

public static Table CreateNew(Model parent, string name = null)

Parameters

Type Name Description
Model parent
string name

Returns

Type Description
Table

CustomReinit()

protected override void CustomReinit()

GetAnnotation(int)

Gets the value of the annotation with the given index, assuming it exists.

public string GetAnnotation(int index)

Parameters

Type Name Description
int index

Returns

Type Description
string

GetAnnotation(string)

Gets the value of the annotation with the given name. Returns null if no such annotation exists.

public string GetAnnotation(string name)

Parameters

Type Name Description
string name

Returns

Type Description
string

GetAnnotations()

Gets a collection of all annotation names on the current Table.

public IEnumerable<string> GetAnnotations()

Returns

Type Description
IEnumerable<string>

GetAnnotationsCount()

Gets the number of annotations on the current Table.

public int GetAnnotationsCount()

Returns

Type Description
int

GetChildren()

Returns all columns, measures, and hierarchies inside this table.

public virtual IEnumerable<ITabularNamedObject> GetChildren()

Returns

Type Description
IEnumerable<ITabularNamedObject>

GetExpression(ExpressionProperty)

Gets the specified expression from the current object.

public virtual string GetExpression(ExpressionProperty expressionProperty)

Parameters

Type Name Description
ExpressionProperty expressionProperty

Returns

Type Description
string

Exceptions

InvalidEnumArgumentException

Thrown when the current object does not support the specified ExpressionProperty

GetExpressionProperties()

Gets all supported expression properties on the current object.

public virtual IEnumerable<ExpressionProperty> GetExpressionProperties()

Returns

Type Description
IEnumerable<ExpressionProperty>

GetExtendedProperties()

Gets a collection of all ExtendedProperty names on the current object.

public IEnumerable<string> GetExtendedProperties()

Returns

Type Description
IEnumerable<string>

GetExtendedProperty(int)

Gets the value of the ExtendedProperty with the given index, assuming it exists.

public string GetExtendedProperty(int index)

Parameters

Type Name Description
int index

Returns

Type Description
string

GetExtendedProperty(string)

Gets the value of the ExtendedProperty with the given name. Returns null if no such ExtendedProperty exists.

public string GetExtendedProperty(string name)

Parameters

Type Name Description
string name

Returns

Type Description
string

GetExtendedPropertyCount()

Gets the number of ExtendedProperties on the current object.

public int GetExtendedPropertyCount()

Returns

Type Description
int

GetExtendedPropertyType(int)

Gets the type of the ExtendedProperty with the given index, assuming it exists.

public ExtendedPropertyType GetExtendedPropertyType(int index)

Parameters

Type Name Description
int index

Returns

Type Description
ExtendedPropertyType

GetExtendedPropertyType(string)

Gets the type of the ExtendedProperty with the given name, assuming it exists.

public ExtendedPropertyType GetExtendedPropertyType(string name)

Parameters

Type Name Description
string name

Returns

Type Description
ExtendedPropertyType

GetNewAnnotationName()

Returns a unique name for a new annotation.

public string GetNewAnnotationName()

Returns

Type Description
string

GetNewExtendedPropertyName()

Returns a unique name for a new ExtendedProperty.

public string GetNewExtendedPropertyName()

Returns

Type Description
string

HasAnnotation(string)

Returns true if an annotation with the given name exists. Otherwise false.

public bool HasAnnotation(string name)

Parameters

Type Name Description
string name

Returns

Type Description
bool

HasExtendedProperty(string)

Returns true if an ExtendedProperty with the given name exists. Otherwise false.

public bool HasExtendedProperty(string name)

Parameters

Type Name Description
string name

Returns

Type Description
bool

Init()

Derived members should override this method to instantiate child objects

protected override void Init()

OnPropertyChanged(string, object, object)

Fired after a property is changed

protected override void OnPropertyChanged(string propertyName, object oldValue, object newValue)

Parameters

Type Name Description
string propertyName
object oldValue
object newValue

OnPropertyChanging(string, object, ref bool, ref bool)

Called before a property is changed on an object. Derived classes can control how the change is handled. Throw ArgumentException within this method, to display an error message in the UI.

protected override void OnPropertyChanging(string propertyName, object newValue, ref bool undoable, ref bool cancel)

Parameters

Type Name Description
string propertyName

Name of the changed property.

object newValue

New value assigned to the property.

bool undoable

Return false if automatic undo of the property change is not needed.

bool cancel

Return true if the property change should not apply.

RemoveAnnotation(string)

Remove an annotation by the given name.

public void RemoveAnnotation(string name)

Parameters

Type Name Description
string name

RemoveExtendedProperty(string)

Remove an ExtendedProperty by the given name.

public void RemoveExtendedProperty(string name)

Parameters

Type Name Description
string name

RemoveRefreshPolicy()

Removes the RefreshPolicy from this measure.

public void RemoveRefreshPolicy()

SetAnnotation(int, string)

Sets the value of the annotation with the given index, assuming it exists.

public void SetAnnotation(int index, string value)

Parameters

Type Name Description
int index
string value

SetAnnotation(string, string)

Sets the value of the annotation having the given name. If no such annotation exists, it will be created. If value is set to null, the annotation will be removed.

public void SetAnnotation(string name, string value)

Parameters

Type Name Description
string name
string value

SetExpression(ExpressionProperty, string)

Sets the specified expression on the current object.

public virtual void SetExpression(ExpressionProperty expressionProperty, string expression)

Parameters

Type Name Description
ExpressionProperty expressionProperty
string expression

Exceptions

InvalidEnumArgumentException

Thrown when the current object does not support the specified ExpressionProperty

SetExtendedProperty(int, string, ExtendedPropertyType)

Sets the value of the ExtendedProperty with the given index, optionally specifiying the type (string or JSON) of the ExtendedProperty.

public void SetExtendedProperty(int index, string value, ExtendedPropertyType type)

Parameters

Type Name Description
int index
string value
ExtendedPropertyType type

SetExtendedProperty(string, string, ExtendedPropertyType)

Sets the value of the ExtendedProperty having the given name. If no such ExtendedProperty exists, it will be created. If value is set to null, the ExtendedProperty will be removed.

public void SetExtendedProperty(string name, string value, ExtendedPropertyType type)

Parameters

Type Name Description
string name
string value
ExtendedPropertyType type