Class CalculatedTable
Implements
Inherited Members
Namespace: TabularEditor.TOMWrapper
Assembly: TOMWrapper.dll
Syntax
public class CalculatedTable : Table, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, IDescriptionObject, ILineageTagObject, IExtendedPropertyObject, ITabularPerspectiveObject, IHideableObject, ITranslatableObject, IAnnotationObject, ISynonymObject, IClonableObject, ITabularObjectContainer, IDaxObject, IDaxDependantObject, ITomErrorMessageObject, IExpressionObject, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, INamedObject
Properties
DefaultExpressionProperty
Gets the default expression property on the current object.
Declaration
public override ExpressionProperty? DefaultExpressionProperty { get; }
Property Value
Type | Description |
---|---|
ExpressionProperty? |
Overrides
Expression
The Expression of this Calculated Table.
Declaration
[Browsable(true)]
public string Expression { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
AddCalculatedTableColumn(string, string, string, DataType)
Adds a new Calculated Table column to the table.
Declaration
public CalculatedTableColumn AddCalculatedTableColumn(string name = null, string sourceColumn = null, string displayFolder = null, DataType dataType = DataType.Automatic)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
string | sourceColumn | |
string | displayFolder | |
DataType | dataType |
Returns
Type | Description |
---|---|
CalculatedTableColumn |
Exceptions
Type | Condition |
---|---|
PowerBIGovernanceException |
CreateNew(Model, string, string)
Creates a new Calculated Table and adds it to the specified Model. Also creates the underlying metadataobject and adds it to the TOM tree.
Declaration
public static CalculatedTable CreateNew(Model parent, string name = null, string expression = null)
Parameters
Type | Name | Description |
---|---|---|
Model | parent | |
string | name | |
string | expression |
Returns
Type | Description |
---|---|
CalculatedTable |
GetExpression(ExpressionProperty)
Gets the specified expression from the current object.
Declaration
public override string GetExpression(ExpressionProperty expressionProperty)
Parameters
Type | Name | Description |
---|---|---|
ExpressionProperty | expressionProperty |
Returns
Type | Description |
---|---|
string |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidEnumArgumentException | Thrown when the current object does not support the specified ExpressionProperty |
GetExpressionProperties()
Gets all supported expression properties on the current object.
Declaration
public override IEnumerable<ExpressionProperty> GetExpressionProperties()
Returns
Type | Description |
---|---|
IEnumerable<ExpressionProperty> |
Overrides
Init()
Derived members should override this method to instantiate child objects
Declaration
protected override void Init()
Overrides
OnPropertyChanged(string, object, object)
Fired after a property is changed
Declaration
protected override void OnPropertyChanged(string propertyName, object oldValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
string | propertyName | |
object | oldValue | |
object | newValue |
Overrides
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.
Declaration
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. |
Overrides
SetExpression(ExpressionProperty, string)
Sets the specified expression on the current object.
Declaration
public override void SetExpression(ExpressionProperty expressionProperty, string expression)
Parameters
Type | Name | Description |
---|---|---|
ExpressionProperty | expressionProperty | |
string | expression |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidEnumArgumentException | Thrown when the current object does not support the specified ExpressionProperty |