<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Conditional formatting on dynamic formatting options in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Conditional-formatting-on-dynamic-formatting-options/m-p/1938858#M30344</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/247681"&gt;@WouterBo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Conditional formatting is now supported in API 3.5 and above&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;It seem that Power BI&amp;nbsp; supports you to add conditional formatting in default color currently.&lt;/P&gt;
&lt;P&gt;Blog:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-platform-release-plan/2020wave2/power-bi/support-conditional-formatting-custom-visuals" target="_self"&gt;Support for conditional formatting for custom visuals&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/visuals/conditional-format" target="_self"&gt;Add conditional formatting&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I think you can try to build a measure as I show above and add it into fx in default color to change the color of fields in your custom visual. It can be more complex and dynamic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rico Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jul 2021 01:56:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-06T01:56:21Z</dc:date>
    <item>
      <title>Conditional formatting on dynamic formatting options</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Conditional-formatting-on-dynamic-formatting-options/m-p/1930283#M30240</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if, using custom visuals API 3.5.1, it is possible to apply conditional formatting to dynamic formatting options. By dynamic formatting options I mean options that are added to the formatting pane as the user adds values to the visual. For instance the data colours that are added to the Funnel visual:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-06-30 at 10.39.17.png" style="width: 190px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/543902i1DF9202115FD884E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-06-30 at 10.39.17.png" alt="Screen Shot 2021-06-30 at 10.39.17.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see here, conditional formatting is available only for the (statically named) "Default color" and not for any of the dynamically added values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, my capabilities.json file contains this for data colors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        "dataColors": {
            "displayName": "Data colors",
            "displayNameKey": "Visual_DataColors",
            "properties": {
                "fill": {
                    "displayName": "Data color",
                    "displayNameKey": "Visual_DataColor",
                    "type": {
                        "fill": {
                            "solid": {
                                "color": true
                            }
                        }
                    }
                }               
            }
        },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And my settings.ts file contains this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export class dataColorsSettings {
  public fill: string = null;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I enumerate my data colors object instance, I add any dynamically added values like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;   private enumerateDataColors(valueColumns: DataViewMetadataColumn[], instanceEnumeration: VisualObjectInstanceEnumeration): VisualObjectInstance[] {
        if (!(&amp;lt;VisualObjectInstanceEnumerationObject&amp;gt;instanceEnumeration).instances) {
            return;
        }

        let instances = (&amp;lt;VisualObjectInstanceEnumerationObject&amp;gt;instanceEnumeration).instances;

        for (let v = 0; v &amp;lt; valueColumns.length; v++) {
            const displayName = valueColumns[v].displayName;
            const selector: ISelectionId = this.host.createSelectionIdBuilder()
                .withMeasure(valueColumns[v].queryName)
                .createSelectionId();
            this.addAnInstanceToEnumeration(instanceEnumeration, {
                displayName,
                objectName: Visual.dataColorsPropertyIdentifier.objectName,
                selector: ColorHelper.normalizeSelector(selector.getSelector(), false),
                properties: {
                    fill: { solid: { color: this.viewModel.valuesColor[v] } }
                }
            });

            let obj = {}
            obj[displayName] = VisualEnumerationInstanceKinds.ConstantOrRule;
            instances[0].selector = dataViewWildcard.createDataViewWildcardSelector(dataViewWildcard.DataViewWildcardMatchingOption.InstancesOnly);
            instances[0].altConstantValueSelector = null;
            instances[0].propertyInstanceKind = obj
        }

        delete instances[0].properties['fill'];

        return &amp;lt;VisualObjectInstance[]&amp;gt;instanceEnumeration;
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While this does add a correct looking propertyInstanceKind object to instances[0], no conditional formatting options appear in the formatting pane.&lt;/P&gt;&lt;P&gt;Since I have not been able to spot a native visual that has conditional formatting for dynamically added values, I'm ready to assume it's simply not supported at the moment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can it be done?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 08:58:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Conditional-formatting-on-dynamic-formatting-options/m-p/1930283#M30240</guid>
      <dc:creator>WouterBo</dc:creator>
      <dc:date>2021-06-30T08:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting on dynamic formatting options</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Conditional-formatting-on-dynamic-formatting-options/m-p/1935090#M30301</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/247681"&gt;@WouterBo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want to use conditional formatting in Funnel visual? "Show all" function is to show all lengeds and let you select colors manually. If you want to show differents colors by date, you can try to build a color measure and add this measure into fx in default color.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My Sample:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.png" style="width: 134px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/545561i968BA78B477ECB2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Color Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
SWITCH(MAX('Table'[Date]),DATE(2021,10,30),"Blue",DATE(2021,12,04),"Yellow","Green")&lt;/LI-CODE&gt;
&lt;P&gt;Click fx , Format by Field value and use Measure.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/545558iB2758AF7DEC92AFF/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Result is as blow.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 481px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/545560i4C0ABF578FB918BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rico Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 10:01:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Conditional-formatting-on-dynamic-formatting-options/m-p/1935090#M30301</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-02T10:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting on dynamic formatting options</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Conditional-formatting-on-dynamic-formatting-options/m-p/1937575#M30334</link>
      <description>&lt;P&gt;Thanks Rico,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;I would like to know if&amp;nbsp; ...&amp;nbsp;it is possible to apply conditional formatting to dynamic formatting options."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm making a custom visual. &lt;/SPAN&gt;&lt;SPAN&gt;Funnel is only an example to show what I mean.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Add dynamic options based on values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Add conditional formatting to dynamically generated formatting options.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can it be done?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 08:36:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Conditional-formatting-on-dynamic-formatting-options/m-p/1937575#M30334</guid>
      <dc:creator>WouterBo</dc:creator>
      <dc:date>2021-07-05T08:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formatting on dynamic formatting options</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Conditional-formatting-on-dynamic-formatting-options/m-p/1938858#M30344</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/247681"&gt;@WouterBo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Conditional formatting is now supported in API 3.5 and above&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;It seem that Power BI&amp;nbsp; supports you to add conditional formatting in default color currently.&lt;/P&gt;
&lt;P&gt;Blog:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-platform-release-plan/2020wave2/power-bi/support-conditional-formatting-custom-visuals" target="_self"&gt;Support for conditional formatting for custom visuals&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/visuals/conditional-format" target="_self"&gt;Add conditional formatting&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I think you can try to build a measure as I show above and add it into fx in default color to change the color of fields in your custom visual. It can be more complex and dynamic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Rico Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 01:56:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Conditional-formatting-on-dynamic-formatting-options/m-p/1938858#M30344</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-06T01:56:21Z</dc:date>
    </item>
  </channel>
</rss>

