<?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/Coloring Values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Formatting-Coloring-Values/m-p/2625885#M76642</link>
    <description>&lt;P&gt;I'm sort of confused a little on this. So do I create a DAX Expression using both the 15 Staff and 5 Staff?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SWITCH(TRUE()&lt;/P&gt;&lt;P&gt;[15 Staff] &amp;lt; #, "Red",&lt;/P&gt;&lt;P&gt;[5 Staff] &amp;gt; #. "Green",&lt;/P&gt;&lt;P&gt;ELSE "Yellow"&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jul 2022 17:17:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-07-07T17:17:25Z</dc:date>
    <item>
      <title>Conditional Formatting/Coloring Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Formatting-Coloring-Values/m-p/2625366#M76630</link>
      <description>&lt;P&gt;Hello all!&lt;/P&gt;&lt;P&gt;I have created a matrix and a table on the same tab of a Power BI Report. (See 1st picture below)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table on the left uses conditional columns which I manually inserted into the table. (For example: If the time is 8:00 AM, then 15 staff is then 49, and so on and so fourth). Both visuals are useing the same times. The values in the matrix are using a column called StudentID, and the values are as Count (Distinct).&lt;/P&gt;&lt;P&gt;I was asked to find a way to color the values on the right as follows:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If the Value is above the 5 Staff number, then color it Green&lt;/LI&gt;&lt;LI&gt;If the Value is below the 15 Staff number, then color it Red&lt;UL&gt;&lt;LI&gt;Ex: On January 25, 2022 the value is 30. This value would be Red&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;If Value is in between, then color is Yellow&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here is an example of the data I am using&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Time&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;StudentName&lt;/TD&gt;&lt;TD&gt;StudentID&lt;/TD&gt;&lt;TD&gt;College&lt;/TD&gt;&lt;TD&gt;CreditHours&lt;/TD&gt;&lt;TD&gt;15 Staff&lt;/TD&gt;&lt;TD&gt;5 Staff&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8:00 AM&lt;/TD&gt;&lt;TD&gt;January 27, 2022&lt;/TD&gt;&lt;TD&gt;Joseph Mann&lt;/TD&gt;&lt;TD&gt;005866&lt;/TD&gt;&lt;TD&gt;Business&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;49&lt;/TD&gt;&lt;TD&gt;51&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9:00 AM&lt;/TD&gt;&lt;TD&gt;January 29, 2022&lt;/TD&gt;&lt;TD&gt;John Doe&lt;/TD&gt;&lt;TD&gt;447856&lt;/TD&gt;&lt;TD&gt;Business&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;TD&gt;77&lt;/TD&gt;&lt;TD&gt;79&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9:30 AM&lt;/TD&gt;&lt;TD&gt;January 25, 2022&lt;/TD&gt;&lt;TD&gt;Jane Doe&lt;/TD&gt;&lt;TD&gt;555013&lt;/TD&gt;&lt;TD&gt;Law&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;TD&gt;70&lt;/TD&gt;&lt;TD&gt;72&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10:00 AM&lt;/TD&gt;&lt;TD&gt;January 25, 2022&lt;/TD&gt;&lt;TD&gt;Ryan Pierce&lt;/TD&gt;&lt;TD&gt;554876&lt;/TD&gt;&lt;TD&gt;Graduate&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;TD&gt;61&lt;/TD&gt;&lt;TD&gt;63&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8:00 AM&lt;/TD&gt;&lt;TD&gt;January 26, 2022&lt;/TD&gt;&lt;TD&gt;Jannette Richardson&lt;/TD&gt;&lt;TD&gt;332146&lt;/TD&gt;&lt;TD&gt;Education&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;49&lt;/TD&gt;&lt;TD&gt;51&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12:00 PM&lt;/TD&gt;&lt;TD&gt;January 27, 2022&lt;/TD&gt;&lt;TD&gt;Dameon Travis&lt;/TD&gt;&lt;TD&gt;958741&lt;/TD&gt;&lt;TD&gt;Business&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;TD&gt;47&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2:00 PM&lt;/TD&gt;&lt;TD&gt;January 28, 2022&lt;/TD&gt;&lt;TD&gt;Marney Phillips&lt;/TD&gt;&lt;TD&gt;004584&lt;/TD&gt;&lt;TD&gt;Education&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;63&lt;/TD&gt;&lt;TD&gt;65&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not really 100% sure how this would be able to get formatted the way I am being asked. Would this be using Variables in a calculation? I struggle so much with variables and some DAX Functions. I've tried to do drop down on the values and conditionally format, however that really didn't work for my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I did attempt to do conditional formatting. However with the rules, I am not able to do conditional formatting based on both 15 Staff and 5 Staff. So it is being sort of odd with it because I am trying to compare the Value between both 15 and 5 Staff. Is there some sort of DAX Expression that can maybe be written to compare the value between both 15 and 5 Staff?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 16:03:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Formatting-Coloring-Values/m-p/2625366#M76630</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-07T16:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting/Coloring Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Formatting-Coloring-Values/m-p/2625703#M76637</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , You can create a color measure based on the condition that should return color and that you can use in conditional formatting using field values &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Switch(true(),&lt;BR /&gt;[SLA] = 1 , "Green" ,&lt;BR /&gt;[SLA] &amp;gt;= .5 , "Amber" ,&lt;BR /&gt;"Red " &lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&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;</description>
      <pubDate>Thu, 07 Jul 2022 15:58:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Formatting-Coloring-Values/m-p/2625703#M76637</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-07-07T15:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting/Coloring Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Formatting-Coloring-Values/m-p/2625885#M76642</link>
      <description>&lt;P&gt;I'm sort of confused a little on this. So do I create a DAX Expression using both the 15 Staff and 5 Staff?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SWITCH(TRUE()&lt;/P&gt;&lt;P&gt;[15 Staff] &amp;lt; #, "Red",&lt;/P&gt;&lt;P&gt;[5 Staff] &amp;gt; #. "Green",&lt;/P&gt;&lt;P&gt;ELSE "Yellow"&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 17:17:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Formatting-Coloring-Values/m-p/2625885#M76642</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-07T17:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Formatting/Coloring Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Formatting-Coloring-Values/m-p/2635364#M77242</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created a sample pbix file(&lt;STRONG&gt;see attachment&lt;/STRONG&gt;) for you, please check whether that is what you want.&lt;/P&gt;
&lt;P&gt;1. Create a &lt;STRONG&gt;measure&amp;nbsp;&lt;/STRONG&gt;as below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Conditional formatting = 
VAR _seltime =
    SELECTEDVALUE ( 'Time'[Time] )
VAR _15staff =
    CALCULATE (
        MAX ( 'Time'[15 Staff] ),
        FILTER ( 'Time', 'Time'[Time] = _seltime )
    )
VAR _5staff =
    CALCULATE (
        MAX ( 'Time'[5 Staff] ),
        FILTER ( 'Time', 'Time'[Time] = _seltime )
    )
RETURN
    SWITCH (
        TRUE,
        [Count of Students] &amp;lt; _15staff, "Red",
        [Count of Students] &amp;gt; _5staff, "Green",
        [Count of Students] &amp;gt;= [Count of Students]
            &amp;amp;&amp;amp; [Count of Students] &amp;lt;= _5staff, "Yellow"
    )&lt;/LI-CODE&gt;
&lt;P&gt;2. Apply conditional formatting for the &lt;STRONG&gt;Values&lt;/STRONG&gt; field&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;sensitive&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;data&lt;/EM&gt;&lt;/STRONG&gt;) with&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 06:41:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Formatting-Coloring-Values/m-p/2635364#M77242</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-13T06:41:16Z</dc:date>
    </item>
  </channel>
</rss>

