<?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: Can you apply different colours to one row? in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266156#M1340407</link>
    <description>&lt;P&gt;I am totally new to all this, and I was pinpointing the [colour] measure as the issue since the rest of the data appears to be working well, but there very may well be other issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The process is as follows&lt;/P&gt;&lt;P&gt;- Employee applies for leave using a digital form&lt;/P&gt;&lt;P&gt;- Leave request is sent for approval to the relevant person&lt;/P&gt;&lt;P&gt;- Data is simultaneously sent to SharePoint list, which is synced to the PowerBI Matrix (the 'Leave Register')&lt;/P&gt;&lt;P&gt;- The Approval status is defaulted to pending until later updated to approved or rejected&lt;/P&gt;&lt;P&gt;- I calculate the 'Leave Count' as per my response to&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;, which gives me a value of 1 in the relevant day/month/year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if this is too much information! Is there any partucliar dataset youd like to see?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2024 22:26:57 GMT</pubDate>
    <dc:creator>Stelz</dc:creator>
    <dc:date>2024-10-31T22:26:57Z</dc:date>
    <item>
      <title>Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4264862#M1339986</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;I have created an annual leave regsiter using a matrix visual where employees are grouped by job description. Im using a measure to colour in my values based on the length of the leave and the status of the approval (i.e approved, pending, rejected). It all appears to work except in the instance where an employee has multiple leave submissions that have differing approval statuses.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;In the selected row, this person has an approved leave and a pending leave, both are coloured Green. It appears the expression I am using is merely prioritising a colour&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;This is the expression im using to conditionally format my background/font colours.&lt;/P&gt;&lt;PRE&gt;Colour = VAR Leave = [Leave count]
RETURN 
SWITCH(
&amp;nbsp; &amp;nbsp; TRUE(),
&amp;nbsp; &amp;nbsp; Leave = 0, "white",
&amp;nbsp; &amp;nbsp; Leave &amp;gt; 0 &amp;amp;&amp;amp; COUNTROWS(FILTER('Leave Register', 'Leave Register'[Approved] = "Approved")) &amp;gt; 0, "#168E6A",
&amp;nbsp; &amp;nbsp; Leave &amp;gt; 0 &amp;amp;&amp;amp; COUNTROWS(FILTER('Leave Register', 'Leave Register'[Approved] = "Pending")) &amp;gt; 0, "#f6e828",
&amp;nbsp; &amp;nbsp; Leave &amp;gt; 0 &amp;amp;&amp;amp; COUNTROWS(FILTER('Leave Register', 'Leave Register'[Approved] = "Rejected")) &amp;gt; 0, "#f63d28",
&amp;nbsp; &amp;nbsp; "white"
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am i missing something, or does Power BI simply have limits in applying different colors within the same row?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 04:06:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4264862#M1339986</guid>
      <dc:creator>Stelz</dc:creator>
      <dc:date>2024-10-31T04:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4264886#M1339992</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833374" data-lia-user-login="Stelz" class="lia-mention lia-mention-user"&gt;Stelz&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems the date context is not working here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How are the date table and the leave register table related?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 04:54:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4264886#M1339992</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2024-10-31T04:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4265068#M1340040</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833374" data-lia-user-login="Stelz" class="lia-mention lia-mention-user"&gt;Stelz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AFAIK, the limit is what your device's memory can handle. I would add Leave count and the COUNTROWS calculations as separate measures to a matrix to check if they return the expected values.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 07:10:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4265068#M1340040</guid>
      <dc:creator>danextian</dc:creator>
      <dc:date>2024-10-31T07:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4265933#M1340319</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833374" data-lia-user-login="Stelz" class="lia-mention lia-mention-user"&gt;Stelz&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SWITCH statements are processed in order, so if you change the order you should be able to acheive what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="https://youtu.be/JggME9yQovA" data-video-remote-vid="https://youtu.be/JggME9yQovA" class="lia-video-container lia-media-is-center lia-media-size-large"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FJggME9yQovA%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJggME9yQovA&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FJggME9yQovA%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 17:18:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4265933#M1340319</guid>
      <dc:creator>KNP</dc:creator>
      <dc:date>2024-10-31T17:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266126#M1340394</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="129725" data-lia-user-login="KNP" class="lia-mention lia-mention-user"&gt;KNP&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe using Switch isnt the right method, as not one approval status has a priority other the other. I want to be able to see each leave in the relevant colour.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 21:34:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266126#M1340394</guid>
      <dc:creator>Stelz</dc:creator>
      <dc:date>2024-10-31T21:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266132#M1340397</link>
      <description>&lt;P&gt;I see what you're saying.&lt;/P&gt;
&lt;P&gt;I think I'd need to see some sample data to better understand, and as&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;mentioned, detail about the mode/relationships.&lt;/P&gt;
&lt;P&gt;What defines uniqueness in the Leave Register table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 21:44:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266132#M1340397</guid>
      <dc:creator>KNP</dc:creator>
      <dc:date>2024-10-31T21:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266137#M1340400</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks for your response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the expression used to calculate the leave count&amp;nbsp;&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;Leave count = 
SUMX 
( SUMMARIZE ('Leave Register', 'Leave Register'[EmployeeName], 'Leave Register'[Leave Start], "+1" , 
COUNTX ( FILTER ('Date', 'Date'[Date] &amp;gt;= MIN ('Leave Register'[Leave Start]) &amp;amp;&amp;amp; 'Date'[Date] &amp;lt;= MAX ('Leave Register'[Leave end])), 
CALCULATE ( COUNT ('Leave Register'[EmployeeName])))),[+1]+ 0 ) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is how the visual looks without the colour formatting applied&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&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, 31 Oct 2024 21:48:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266137#M1340400</guid>
      <dc:creator>Stelz</dc:creator>
      <dc:date>2024-10-31T21:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266143#M1340403</link>
      <description>&lt;P&gt;I understand not all values will be visible because im working over a timeline, but i only need the current date + 2-3 months in advance. I plan to filter out values older than today.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measures added to a seperate matrix are giving the correct values&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, 31 Oct 2024 21:56:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266143#M1340403</guid>
      <dc:creator>Stelz</dc:creator>
      <dc:date>2024-10-31T21:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266156#M1340407</link>
      <description>&lt;P&gt;I am totally new to all this, and I was pinpointing the [colour] measure as the issue since the rest of the data appears to be working well, but there very may well be other issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The process is as follows&lt;/P&gt;&lt;P&gt;- Employee applies for leave using a digital form&lt;/P&gt;&lt;P&gt;- Leave request is sent for approval to the relevant person&lt;/P&gt;&lt;P&gt;- Data is simultaneously sent to SharePoint list, which is synced to the PowerBI Matrix (the 'Leave Register')&lt;/P&gt;&lt;P&gt;- The Approval status is defaulted to pending until later updated to approved or rejected&lt;/P&gt;&lt;P&gt;- I calculate the 'Leave Count' as per my response to&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;, which gives me a value of 1 in the relevant day/month/year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if this is too much information! Is there any partucliar dataset youd like to see?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 22:26:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266156#M1340407</guid>
      <dc:creator>Stelz</dc:creator>
      <dc:date>2024-10-31T22:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266160#M1340410</link>
      <description>&lt;P&gt;What I meant was you need to set it up the same way you did with&amp;nbsp; your current matrix visual. There will be more measures in there in total. That is for you to check if they return the expected values.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 22:39:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266160#M1340410</guid>
      <dc:creator>danextian</dc:creator>
      <dc:date>2024-10-31T22:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can you apply different colours to one row?</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266214#M1340428</link>
      <description>&lt;P&gt;It's all useful info, a screenshot of your data model showing the relationships would help.&lt;/P&gt;
&lt;P&gt;I think, if I understand correctly, the approach I would take is slightly different (and may not work &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your Leave Status was something like this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Leave Status = 
VAR ApprovedCount = COUNTROWS(FILTER('Leave Register', 'Leave Register'[Approved] = "Approved"))
VAR PendingCount = COUNTROWS(FILTER('Leave Register', 'Leave Register'[Approved] = "Pending"))
VAR RejectedCount = COUNTROWS(FILTER('Leave Register', 'Leave Register'[Approved] = "Rejected"))
RETURN 
SWITCH(
    TRUE(),
    ApprovedCount &amp;gt; 0, 1,
    PendingCount &amp;gt; 0, 2,
    RejectedCount &amp;gt; 0, 3,
    0
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And your colour measure something like this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Colour = 
VAR LeaveStatus = [Leave Status]
RETURN 
SWITCH(
    LeaveStatus,
    0, "rgba(0,0,0,0)",
    1, "#168E6A",  // Approved
    2, "#f6e828",  // Pending
    3, "#f63d28",  // Rejected
    "rgba(0,0,0,0)"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's a chance this could simplify it.&lt;/P&gt;
&lt;P&gt;The code is untested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 01:04:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Can-you-apply-different-colours-to-one-row/m-p/4266214#M1340428</guid>
      <dc:creator>KNP</dc:creator>
      <dc:date>2024-11-01T01:04:26Z</dc:date>
    </item>
  </channel>
</rss>

