<?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 Color Shade Format for Each Cell in a Row in a Table in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Conditional-Color-Shade-Format-for-Each-Cell-in-a-Row-in-a-Table/m-p/4714884#M12554</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/926729"&gt;@Dawg&lt;/a&gt;&amp;nbsp; Can you provide me a Sample data to work with ? So that I can provide you the DAX accordingly&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.linkedin.com/in/jai-rathinavel/" target="_blank"&gt;Jai Rathinavel | LinkedIn&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 31 May 2025 05:42:00 GMT</pubDate>
    <dc:creator>Jai-Rathinavel</dc:creator>
    <dc:date>2025-05-31T05:42:00Z</dc:date>
    <item>
      <title>Conditional Color Shade Format for Each Cell in a Row in a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Conditional-Color-Shade-Format-for-Each-Cell-in-a-Row-in-a-Table/m-p/4714612#M12553</link>
      <description>&lt;P&gt;I need to conditionally format each row in a table differently. In the example table below, the threshold for what is "red", "yellow", or "green" is different for each row.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I conditionally format each row so that the threshold colors are properly captured for each row?&amp;nbsp;&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="Screenshot 2025-05-30 134717.png" style="width: 345px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1272828i420418466E8ADCBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-05-30 134717.png" alt="Screenshot 2025-05-30 134717.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 17:59:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Conditional-Color-Shade-Format-for-Each-Cell-in-a-Row-in-a-Table/m-p/4714612#M12553</guid>
      <dc:creator>Dawg</dc:creator>
      <dc:date>2025-05-30T17:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Color Shade Format for Each Cell in a Row in a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Conditional-Color-Shade-Format-for-Each-Cell-in-a-Row-in-a-Table/m-p/4714884#M12554</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/926729"&gt;@Dawg&lt;/a&gt;&amp;nbsp; Can you provide me a Sample data to work with ? So that I can provide you the DAX accordingly&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.linkedin.com/in/jai-rathinavel/" target="_blank"&gt;Jai Rathinavel | LinkedIn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2025 05:42:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Conditional-Color-Shade-Format-for-Each-Cell-in-a-Row-in-a-Table/m-p/4714884#M12554</guid>
      <dc:creator>Jai-Rathinavel</dc:creator>
      <dc:date>2025-05-31T05:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Color Shade Format for Each Cell in a Row in a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Conditional-Color-Shade-Format-for-Each-Cell-in-a-Row-in-a-Table/m-p/4722131#M12571</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Hello&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/926729"&gt;@Dawg&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I’d recommend approaching this in three steps:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;1) Add a column for each of the threshold values, this would mean adding a column for red to each &amp;nbsp;your table becomes&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;Red&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;Yellow&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;Green&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;2024&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;2025&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;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lt;P&gt;&lt;SPAN&gt;13&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;15&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;Item 3&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;30&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;20&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;30&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Second step is to make a calculated column that determines the final color, this can be done using a switch statement like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_2024color = SWITCH(TRUE, 
    /* replace Query1 with your table name */
    Query1[2024] &amp;lt;= Query1[Green],"green",
    Query1[2024] &amp;lt;= Query1[Yellow],"yellow",
    Query1[2024] &amp;lt;= Query1[Red],"red"
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;since you are using two columns here, you’ll have to add one for each value you want to color.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&amp;gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Note: you can also use &lt;/SPAN&gt;&lt;A href="https://colorkit.co/hex-color-codes/" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;hex colors&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; instead of the color name&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;3) &lt;/SPAN&gt;&lt;SPAN&gt;Finally you can use conditional formatting to color the actual text box, select the column you want to change, enable conditional formatting, change the formatting style to “Field Value”, and set the value of “What field should we base this on?” to the calculated column we made in step 2.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="grognard_0-1749169986016.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1274288i233CA0F4B19B9F3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="grognard_0-1749169986016.png" alt="grognard_0-1749169986016.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here's a diagram of the steps&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="grognard_1-1749169986017.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1274289i8AE59224070946AC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="grognard_1-1749169986017.png" alt="grognard_1-1749169986017.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;You could also use formatting to change the color of other kinds of charts if you like.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 00:39:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Conditional-Color-Shade-Format-for-Each-Cell-in-a-Row-in-a-Table/m-p/4722131#M12571</guid>
      <dc:creator>grognard</dc:creator>
      <dc:date>2025-06-06T00:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Color Shade Format for Each Cell in a Row in a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Conditional-Color-Shade-Format-for-Each-Cell-in-a-Row-in-a-Table/m-p/4724512#M12572</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/926729"&gt;@Dawg&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;To conditionally format each row in Power BI’s Table visual with row-specific thresholds, follow these steps using DAX and conditional formatting rules:&lt;/P&gt;&lt;H3&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Understanding the Problem&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;In your table:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Each row (Item) has its own threshold for Red, Yellow, and Green.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;You want to apply background color formatting to the 2024 and 2025 values based on that row’s threshold.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Solution Overview&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;Power BI’s built-in conditional formatting does not directly support row-level thresholds, so we solve this by:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Creating custom DAX measures or columns that return hex color codes based on row-specific thresholds.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Applying those values to the background color in the visual using Field value formatting.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Steps to Implement&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;H4&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Step 1: Reshape Your Table to Long Format (Optional but Recommended)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;&lt;P&gt;&lt;EM&gt;Use Power Query to convert:&lt;/EM&gt;&lt;BR /&gt;| Item | Threshold Red | Threshold Yellow | Threshold Green | 2024 | 2025 |&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;into:&lt;/EM&gt;&lt;BR /&gt;| Item | Year | Value | Threshold Red | Threshold Yellow | Threshold Green |&lt;/P&gt;&lt;H4&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Step 2: Create a New Column or Measure for Color&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;&lt;P&gt;In DAX, create a calculated column or measure that checks the year-specific value against the row-specific thresholds.&lt;/P&gt;&lt;P&gt;Example (for a column format like Value, Item, Year, Threshold_Red, etc.):&lt;/P&gt;&lt;PRE&gt;Color Code = 
SWITCH(TRUE(),
    'Table'[Value] &amp;gt;= 'Table'[Threshold_Red], "#FF0000",       // Red
    'Table'[Value] = 'Table'[Threshold_Yellow], "#FFFF00",     // Yellow
    'Table'[Value] &amp;lt;= 'Table'[Threshold_Green], "#00FF00",     // Green
    "#FFFFFF" // Default white
)&lt;/PRE&gt;&lt;P&gt;You can also break this into two separate measures if needed — one for 2024 and one for 2025 — by applying a filter inside a measure.&lt;/P&gt;&lt;H4&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Step 3: Apply Conditional Formatting in Table Visual&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Select your Table visual.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Go to the column for 2024 or 2025.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Click &lt;STRONG&gt;More options (…) &amp;gt; Conditional Formatting &amp;gt; Background color&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Choose &lt;STRONG&gt;“Format by: Field value”&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Set the field to your custom DAX column or measure (Color Code).&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Repeat for each year if needed.&lt;/P&gt;&lt;H3&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Things To Remember:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;You must use a table visual, not a matrix or card.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;For multiple years, creating separate color measures like Color_2024, Color_2025 might&amp;nbsp;simplify application.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Ensure your data model is properly normalized for dynamic scaling.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/nasif-azam-9aa2331a0/" target="_blank" rel="noopener nofollow noreferrer"&gt;Nasif Azam&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jun 2025 14:27:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Conditional-Color-Shade-Format-for-Each-Cell-in-a-Row-in-a-Table/m-p/4724512#M12572</guid>
      <dc:creator>Nasif_Azam</dc:creator>
      <dc:date>2025-06-08T14:27:10Z</dc:date>
    </item>
  </channel>
</rss>

