Object properties
Lists all the available properties of the objects contained in the dynamic data definition JavaScript object.
The following tables list the properties that are available for use when defining the JavaScript object for dynamic data definition of report slicers.
Property types:
The property types of the below described properties can be: O = Optional N = Needed = May be needed under some circumstances C = Compulsory
Top-level slicer object properties
| Property | Type | Description |
|---|---|---|
name | O | Name of the slicer purely to help you identify the slicer. |
description | O | Description of the slicer purely to help you identify the slicer. |
target | N | May be needed if there are more then one target for the slicer, in which case the target must be specified. This object has two properties - table and column - which both must EXACTLY MATCH the same properties of the slicer. |
format | O | The format string to be used to format the items produced by the expression. For example if the result of the |
expression | N | A function that generates a value or list of values that will be checked against selectConditions to be included and selected. NOTE that due to the way how Power BI currently works any values that the slicer selection lists are supposed to contain but not have selected must be present in the data of the underlying target table(s). The expression can generate additional values that are not present in the underlying table(s) but these will also be automatically pre-selected. Power BI currently does not seem to allow adding values to the slicer list without selecting them at the same time. |
selectConditions | N | If any items generated by the expression are to be selected they must return true from running this condition expression. If the condition returns false and at the same time the value is not present in the underlying data table such value will not be present in the list. IMPORTANT: Only values generated by The allowed values of this property are:
|
values | N | Is an array which can contain one of the following:
|
Lower-level object properties
target properties
| Property | Type | Description |
|---|---|---|
table | C | The name of the underlying data source table. |
column | C | The name of the linked data table column. |
value properties
The value property is an array of either objects or sub-arrays.
value objects properties
If the value array contains objects then these represent distinct list definitions and the first one whose condition will evaluate to true will be used to generate the value list and to select those values.
| Property | Type | Description |
|---|---|---|
condition | C | An expression which when it evaluates to true will override any properties defined in the parent object. The condition in these objects in the values list is evaluate for each of the contained objects until the evaluation returns true. When it does the evaluation of any subsequent object's condition is skipped and the current object's properties are used as overrides for the parent objects definition. The last object in this list may have the condition property omitted in which case it will be used to override the parent's properties if no other preceding object's condition property evaluated to true.An example condition: |
name | O | Overrides the same property in the parent object. |
description | O | Overrides the same property in the parent object. |
target | O | Overrides the same property in the parent object. |
format | O | Overrides the same property in the parent object. |
expression | O | Overrides the same property in the parent object. |
selectConditions | O | Overrides the same property in the parent object. |
value sub-arrays properties
If the value array contains sub-arrays then each of these sub-arrays represents a single value that the slicer should contain in its selection list.
The sub-arrays can have one to three properties like so: ["string or expression", isExpression, isSelected].
| Property | Type | Description |
|---|---|---|
string or expression | C | Either a direct value expressed as a string or a string representing an expression that needs to be evaluated to get the value. |
isExpression | O | true if the string or expression is in fact an expression. Defaults to false. |
isSelected | O | true if this value should be selected. Defaults to false. |