<?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: Filtering Data based on most recent data labels in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Data-based-on-most-recent-data-labels/m-p/1526476#M29887</link>
    <description>&lt;P&gt;Update:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I managed to solve Part 1 above but altering the DAX formula used for my colour coding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Originally my colour coding was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current Colour = IF('Table1'[Measure] &amp;gt;=90,1,&lt;/P&gt;&lt;P&gt;IF('Table1'[Measure] &amp;lt;90 &amp;amp;&amp;amp; 'Table1'[Measure] &amp;gt;0,2,&lt;/P&gt;&lt;P&gt;IF('Table1'[Measure] &amp;lt;= 0, 3)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the same formula for the 'Previous Colour'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I simply added another part to the If statement as shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current Colour = IF('Table1'[Measure] &amp;gt;=90,1 &lt;STRONG&gt;&amp;amp;&amp;amp; 'Table1'[Measure2] &amp;gt;0&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;IF('Table1'[Measure] &amp;lt;90 &amp;amp;&amp;amp; 'Table1'[Measure] &amp;gt;0 &lt;STRONG&gt;&amp;amp;&amp;amp; 'Table1'[Measure2]&amp;gt;0&lt;/STRONG&gt;,2,&lt;/P&gt;&lt;P&gt;IF('Table1'[Measure] &amp;lt;= 0 &lt;STRONG&gt;&amp;amp;&amp;amp; 'Table1'[Measure2] &amp;gt;0&lt;/STRONG&gt;, 3,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF('Table1'[Measure2] =0,4)&lt;/STRONG&gt;)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then added a new rule for 4 to turn the cells white. Measure 2 is a sum of two calculated columns that search to see whether the person/task/team were in the previous or current month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still stuck on Part 2, if there is anything that can be done.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;E&lt;/P&gt;</description>
    <pubDate>Tue, 01 Dec 2020 12:55:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-12-01T12:55:31Z</dc:date>
    <item>
      <title>Filtering Data based on most recent data labels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Data-based-on-most-recent-data-labels/m-p/1524563#M29807</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping someone could help me. I've created a Power Bi report that will track when someone complets a task and whether they are due to complete the same task again (of it they've let it lapse and therefore it's due). I suppose you could say that this question is in two parts:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My table is set to show the current period based on the previous period, and as a lot of dates between periods may just be the same (because someone may not need to complete a task again for a year or two) I have used a MAX function to get the current date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem I had is what about new starters and leavers who perhaps don't have a 'previous' or 'current' record because that information isn't in the data (as opposed to someone who has been in the team for a while and just hasn't done their work). So to fix this I created a couple of calculated columns to search for pervious/current names and then modified my measures to take this into account. &lt;STRONG&gt;This is my table currently:&lt;/STRONG&gt;&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;&lt;P&gt;My table is then filtered down using a team. &lt;STRONG&gt;All this works fine&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The two part problem I have is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Part 1:&lt;/STRONG&gt; The colour coding works fine using this formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Colour = IF('Table1'[TaskminusDays] &amp;gt;=90,1,&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;IF('Table1'[TaskminusDays] &amp;lt;90 &amp;amp;&amp;amp; 'Table1'[TaskminusDays] &amp;gt;0,2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;IF('Table1'[TaskminusDays] &amp;lt;=0,3)))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Conditional Formatting - Background Colour&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1 = Green&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2 = Amber&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3 = Red&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Blank = Red&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I can't seem to figure out how to modify this (and the measures feeding into this) so that any new starters/leavers are just ignored and therefore their empty cell will be colourless. I can't just put Blank is no colour because what if someone has been in the team for say 5 years and just not logging their tasks correctly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Part 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been looking through so many forums today to try and answer this question but I just can't seem to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What happens if someone moves between teams within the department???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently on the face of it my table looks like the above however Person1 moved teams within the last month. So if I filter down to their previous team is looks like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Previous Team Filter&lt;/STRONG&gt;&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;&lt;STRONG&gt;Current Team Filter&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Desired Result: Current Team Filter&lt;/STRONG&gt; &lt;EM&gt;(Person1 has been removed from the records of their previous team and therefore doesn't come up)&lt;/EM&gt;&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;&lt;P&gt;Please see attached a copy of my report with the some measures/caclulated columns in to make this all make sense (Some might be "broken" but they are written out as they are in my current report).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dashboard (I've saved this to my OneDrive and put the link to it below)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Sample Report" href="https://1drv.ms/u/s!Anq4uQF2Yu4hoWorYjKqJtVmomTd?e=da0QLk" target="_self"&gt;https://1drv.ms/u/s!Anq4uQF2Yu4hoWorYjKqJtVmomTd?e=da0QLk&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 15:41:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Data-based-on-most-recent-data-labels/m-p/1524563#M29807</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-30T15:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Data based on most recent data labels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Data-based-on-most-recent-data-labels/m-p/1526476#M29887</link>
      <description>&lt;P&gt;Update:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I managed to solve Part 1 above but altering the DAX formula used for my colour coding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Originally my colour coding was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current Colour = IF('Table1'[Measure] &amp;gt;=90,1,&lt;/P&gt;&lt;P&gt;IF('Table1'[Measure] &amp;lt;90 &amp;amp;&amp;amp; 'Table1'[Measure] &amp;gt;0,2,&lt;/P&gt;&lt;P&gt;IF('Table1'[Measure] &amp;lt;= 0, 3)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the same formula for the 'Previous Colour'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I simply added another part to the If statement as shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current Colour = IF('Table1'[Measure] &amp;gt;=90,1 &lt;STRONG&gt;&amp;amp;&amp;amp; 'Table1'[Measure2] &amp;gt;0&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;IF('Table1'[Measure] &amp;lt;90 &amp;amp;&amp;amp; 'Table1'[Measure] &amp;gt;0 &lt;STRONG&gt;&amp;amp;&amp;amp; 'Table1'[Measure2]&amp;gt;0&lt;/STRONG&gt;,2,&lt;/P&gt;&lt;P&gt;IF('Table1'[Measure] &amp;lt;= 0 &lt;STRONG&gt;&amp;amp;&amp;amp; 'Table1'[Measure2] &amp;gt;0&lt;/STRONG&gt;, 3,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF('Table1'[Measure2] =0,4)&lt;/STRONG&gt;)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then added a new rule for 4 to turn the cells white. Measure 2 is a sum of two calculated columns that search to see whether the person/task/team were in the previous or current month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still stuck on Part 2, if there is anything that can be done.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;E&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 12:55:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Data-based-on-most-recent-data-labels/m-p/1526476#M29887</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-01T12:55:31Z</dc:date>
    </item>
  </channel>
</rss>

