<?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: Dynamic conditional formatting based on person selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-conditional-formatting-based-on-person-selection/m-p/3077582#M107056</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="433015" data-lia-user-login="v-yueyunzh-msft" class="lia-mention lia-mention-user"&gt;v-yueyunzh-msft&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this.&lt;BR /&gt;&lt;BR /&gt;I managed to create a seperate measure creating a percentage of opportunity value to individual&amp;nbsp; quarterly goals and did conditional formatting rules based off this measure. Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Feb 2023 11:06:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-02-13T11:06:56Z</dc:date>
    <item>
      <title>Dynamic conditional formatting based on person selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-conditional-formatting-based-on-person-selection/m-p/3071646#M106649</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a table summarising the value of opportunities secured by a sales team per quarter, the columns are as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-center"&gt;Quarter: A DateGlobalFilter table with a [Quarter] variable.&lt;/P&gt;&lt;P class="lia-align-center"&gt;SumActualValue: A measure of won opportunity values.&lt;/P&gt;&lt;P class="lia-align-center"&gt;Role Goal (Quarterly): A measure with HASONEVALUE and SWITCH, where if all team selected (slicer), £15m/quarter, and if a person's selected its changed to individual goals.&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;img /&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-center"&gt;I am looking to have conditional formatting within the SumActualValue column so that the background colour spans from red to green depending on how close they are to the goal, but I am struggling with the DAX as I need the colouring to change dependant on the goal if changed.&lt;/P&gt;&lt;P class="lia-align-center"&gt;(E.g. Q3 From my picture - Would be an orange colour [as about 30% of goal of £15m], but if I select a person with a quarterly goal of £2m and they secured £2.5m, I need this to change to green. So not comparing to the team goal of £15m.)&lt;/P&gt;&lt;P class="lia-align-center"&gt;Here is my attempt at DAX which hopefully VAR only needs changing (can change colour descriptions to numbers and do rules in cond. formatting):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SecuredOpportunityValueColour = 
VAR
QOppValue = // not sure for this. Variable for team selection/names is 'TeamUsers'[PersonName]. 
RETURN
IF(
    HASONEVALUE(TeamUsers[PersonName]),
        SWITCH(
    TRUE(), 
    QOppValue &amp;lt; ([Role Goal (Quarterly)])/4, "Red",
    (AND(QOppValue &amp;lt; ([Role Goal (Quarterly)])/2, QOppValue &amp;gt;= ([Role Goal (Quarterly)])/4)), "Orange",
    (AND(QOppValue &amp;lt; ([Role Goal (Quarterly)])/(4/3), QOppValue &amp;gt;= ([Role Goal (Quarterly)])/2)), "Yellow",
    QOppValue &amp;gt;= ([Role Goal (Quarterly)])/(4/3), "Green"), 
        "Grey")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P class="lia-align-center"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 14:04:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-conditional-formatting-based-on-person-selection/m-p/3071646#M106649</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-09T14:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic conditional formatting based on person selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-conditional-formatting-based-on-person-selection/m-p/3073387#M106766</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to get the [QOppValue ] value.&lt;/P&gt;
&lt;P&gt;And the [QOppValue ] value seems to get from the [&lt;SPAN&gt;Role Goal (Quarterly)&lt;/SPAN&gt;]?&lt;/P&gt;
&lt;P&gt;If this , you just need to make the [&lt;SPAN&gt;Role Goal (Quarterly)&lt;/SPAN&gt;] return right in your logic in the visual .&lt;/P&gt;
&lt;P&gt;And then you can use the&amp;nbsp;[&lt;SPAN&gt;Role Goal (Quarterly)&lt;/SPAN&gt;]&amp;nbsp; in your 'QOppValue' parameter.&lt;/P&gt;
&lt;P&gt;var&amp;nbsp;QOppValue= [&lt;SPAN&gt;Role Goal (Quarterly)&lt;/SPAN&gt;]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If i got missing in your need , can you&amp;nbsp;provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 02:05:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-conditional-formatting-based-on-person-selection/m-p/3073387#M106766</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2023-02-10T02:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic conditional formatting based on person selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-conditional-formatting-based-on-person-selection/m-p/3077582#M107056</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="433015" data-lia-user-login="v-yueyunzh-msft" class="lia-mention lia-mention-user"&gt;v-yueyunzh-msft&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this.&lt;BR /&gt;&lt;BR /&gt;I managed to create a seperate measure creating a percentage of opportunity value to individual&amp;nbsp; quarterly goals and did conditional formatting rules based off this measure. Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 11:06:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-conditional-formatting-based-on-person-selection/m-p/3077582#M107056</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-13T11:06:56Z</dc:date>
    </item>
  </channel>
</rss>

