<?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: Use a slicer to apply conditional formatting on a chart in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775985#M147570</link>
    <description>&lt;P&gt;If I use calculated column, I can get this to fill the values of a column as expected, however as this is static data and will not update when changing the slicer, this is not the solution for me.&amp;nbsp;&lt;BR /&gt;For context, the issue I was having is that I duplicated the data using Reference = 'AllProducts' and I believe this was crating the circular dependency error I saw before.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Measures do not have row context unless used with specific functions (all of which are not applicable here).&amp;nbsp;&lt;BR /&gt;However, I do not need to calculate the full column at once, only to pass the current data to my measure when we need a result.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IsSelectedProduct =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Reference'&lt;/SPAN&gt;&lt;SPAN&gt;[Model]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'L-Acoustics'&lt;/SPAN&gt;&lt;SPAN&gt;[Model]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Yellow"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Blue"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;This evaluates the current selected row of my table data when needed and compares it to the selected product.&amp;nbsp;&lt;BR /&gt;Then I can create a conditional formatting rule based on this measure. If the result is 'Yellow' then display the marker as yellow&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 19 Mar 2024 16:48:14 GMT</pubDate>
    <dc:creator>Samp17</dc:creator>
    <dc:date>2024-03-19T16:48:14Z</dc:date>
    <item>
      <title>Use a slicer to apply conditional formatting on a chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775801#M147556</link>
      <description>&lt;P&gt;I have a table listing products and their properties that I would like to display in a scatter chart.&lt;/P&gt;&lt;P&gt;My objective is to use a Slicer to select one product to use as a 'reference' - I would like this one product to appear as a different marker color compared to the rest of the products in the scatter chart.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I have duplicated my product table, and assigned a slicer to this table so that I may select product without filtering the dataset for my chart.&lt;/P&gt;&lt;P&gt;My understanding is that I need to create a new measure (or new calculated column - unsure which), get the SELECTEDVALUE of the 'reference table with filter' and to compare it with the rows in my table for the chart data.&amp;nbsp; If equal, enter "YELLOW",&amp;nbsp; else enter "BLUE".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried with both a measure and a column, but both give me errors I do not understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For a Measure I am told that a single value for column 'Product' in 'AllProducts' cannot be determined.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Marker color =&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Reference'&lt;/SPAN&gt;&lt;SPAN&gt;[Product]&lt;/SPAN&gt;&lt;SPAN&gt;) == (&lt;/SPAN&gt;&lt;SPAN&gt;'AllProducts'&lt;/SPAN&gt;&lt;SPAN&gt;[Product]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"Yellow"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Blue"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;For a calculated column, I am told the following expression gives a circular dependency.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Marker color =&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Reference'&lt;/SPAN&gt;&lt;SPAN&gt;[Product]&lt;/SPAN&gt;&lt;SPAN&gt;) == &lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'AllProducts'&lt;/SPAN&gt;&lt;SPAN&gt;[PRODUCT]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"Yellow", "Blue"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Ultimately, I then want to create a formatting rule for the marker based on this 'color column' where I can map a value "Yellow" to a color.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can anybody help me progress as I have been working on this issue for several hours? Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 15:32:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775801#M147556</guid>
      <dc:creator>Samp17</dc:creator>
      <dc:date>2024-03-19T15:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Use a slicer to apply conditional formatting on a chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775856#M147558</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="708339" data-lia-user-login="Samp17" class="lia-mention lia-mention-user"&gt;Samp17&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A more effective approach might involve using a measure that dynamically checks the slicer selection and then applying conditional formatting based on this measure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Instead of a calculated column, create a measure that checks if the current row's product matches the selected product in the slicer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IsSelectedProduct = 
IF (
    SELECTEDVALUE('Reference'[Product]) = 'AllProducts'[Product],
    "Yellow",
    "Blue"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then use this me&lt;SPAN&gt;asure to apply conditional formatting to your scatter chart.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In Power BI, you can do this by:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Selecting your scatter chart.&lt;/LI&gt;&lt;LI&gt;Going to the Format pane.&lt;/LI&gt;&lt;LI&gt;Navigating to the Data colors section.&lt;/LI&gt;&lt;LI&gt;Clicking on the "Color based on" dropdown and selecting your measure (IsSelectedProduct).&lt;/LI&gt;&lt;LI&gt;Mapping the values "Yellow" and "Blue" to the desired colors.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 15:47:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775856#M147558</guid>
      <dc:creator>Daoud_H</dc:creator>
      <dc:date>2024-03-19T15:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Use a slicer to apply conditional formatting on a chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775879#M147559</link>
      <description>&lt;P&gt;This confirms I am on the right path.&amp;nbsp;&lt;BR /&gt;I have tried again creating the measure with your expression above and I am faced with this issue:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;(Apologies, the column name was not 'product' as previously mentioned, it is 'Model')&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 15:55:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775879#M147559</guid>
      <dc:creator>Samp17</dc:creator>
      <dc:date>2024-03-19T15:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Use a slicer to apply conditional formatting on a chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775899#M147561</link>
      <description>&lt;P&gt;Try this instead :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IsSelectedProduct = 
VAR SelectedProduct = 
    CALCULATE(
        MAX('Reference'[Model]),
        ALLSELECTED('Reference'[Model])
    )
RETURN
    IF (
        'AllProducts'[Model] = SelectedProduct,
        "Yellow",
        "Blue"
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 19 Mar 2024 16:01:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775899#M147561</guid>
      <dc:creator>Daoud_H</dc:creator>
      <dc:date>2024-03-19T16:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Use a slicer to apply conditional formatting on a chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775941#M147563</link>
      <description>&lt;P&gt;Sadly I have exactly the same error message shown in this case too.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have found the following article which explains that measures do not have row context.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/row-context-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/row-context-in-dax/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I am not sure where to go from here though.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 16:20:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775941#M147563</guid>
      <dc:creator>Samp17</dc:creator>
      <dc:date>2024-03-19T16:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Use a slicer to apply conditional formatting on a chart</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775985#M147570</link>
      <description>&lt;P&gt;If I use calculated column, I can get this to fill the values of a column as expected, however as this is static data and will not update when changing the slicer, this is not the solution for me.&amp;nbsp;&lt;BR /&gt;For context, the issue I was having is that I duplicated the data using Reference = 'AllProducts' and I believe this was crating the circular dependency error I saw before.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Measures do not have row context unless used with specific functions (all of which are not applicable here).&amp;nbsp;&lt;BR /&gt;However, I do not need to calculate the full column at once, only to pass the current data to my measure when we need a result.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IsSelectedProduct =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Reference'&lt;/SPAN&gt;&lt;SPAN&gt;[Model]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'L-Acoustics'&lt;/SPAN&gt;&lt;SPAN&gt;[Model]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Yellow"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Blue"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;This evaluates the current selected row of my table data when needed and compares it to the selected product.&amp;nbsp;&lt;BR /&gt;Then I can create a conditional formatting rule based on this measure. If the result is 'Yellow' then display the marker as yellow&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Mar 2024 16:48:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-a-slicer-to-apply-conditional-formatting-on-a-chart/m-p/3775985#M147570</guid>
      <dc:creator>Samp17</dc:creator>
      <dc:date>2024-03-19T16:48:14Z</dc:date>
    </item>
  </channel>
</rss>

