Forum Discussion

Tung's avatar
Tung
Frequent Visitor
1 year ago
Solved

How can I get back the conditional statement in instanceKind: powerbi.VisualEnumerationInstanceKinds

Hi everyone, I need your assistance. I’ve configured a ColorPicker with a condition like this:   new formattingSettings.ColorPicker({ name: dataPoint.name, displayName: dataPoint.displayN...
  • v-csrikanth's avatar
    1 year ago

    Hi Tung 
    According to Power BI documentation, conditional formatting is primarily supported for visuals like tables, matrices, and charts. However, for "table-based visuals" defined using dataViewMappings with the "table" type, conditional formatting is not supported. Reference link.

    If you want to enable conditional formatting in your custom visual:

    1. Consider switching from a "table" mapping to a "categorical" mapping (dataViewMappings.categorical). Categorical mappings allow access to individual categories and values, which are compatible with conditional formatting2.
    2. Ensure that your visual's settings include both instanceKind: ConstantOrRule and a proper selector configuration.
    3. Use the dataView.categorical.categories.objects[ ] property to retrieve and apply user-defined conditional formatting rules dynamically.


    If the above information helps you, please give us a Kudos and marked the Accept as a solution.
    Best Regards,
    Community Support Team _ C Srikanth.