<?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: Calculated Column to Flag Change in Value by Employee ID, Month Over Month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3093509#M108458</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; ,New column&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Flag = var _max = maxx(filter( 'Table', 'Table'[persiD] &amp;lt; earlier( 'Table'[persiD] ) &amp;amp;&amp;amp; 'Table'[Month] &amp;lt; earlier( 'Table'[Month] )), 'Table'[Month] )&lt;BR /&gt;return &lt;BR /&gt;if( isblank(_max) || 'Table'[CoCOde] = maxx(filter( 'Table', 'Table'[persiD] &amp;lt; earlier( 'Table'[persiD] ) &amp;amp;&amp;amp; 'Table'[Month] =_month), 'Table'[CoCOde] ),0,1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI DAX- Earlier, I should have known Earlier: &lt;A href="https://youtu.be/CVW6YwvHHi8" target="_blank"&gt;https://youtu.be/CVW6YwvHHi8&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2023 16:48:09 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2023-02-22T16:48:09Z</dc:date>
    <item>
      <title>Calculated Column to Flag Change in Value by Employee ID, Month Over Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3093479#M108454</link>
      <description>&lt;P&gt;Thanks for any help you can provide!&lt;/P&gt;&lt;P&gt;I have spend too much time trying to figure this out, so figured it was time to bring it here.&amp;nbsp; I have searched other threads, but am not finding a relatable solution...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table of employee data that contains a row for each month, for each employee - for up to 28 months.&amp;nbsp; In other words, Employee A will have 28 rows of data showing their status and particulars for that month.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a few calculated columns to essentially flag changes in employee details (position code, position type, company, etc.) from one month to the next.&amp;nbsp; I want the calculated colum to show "1" if there was a change from the prior month, and "0" for no change.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a sample table to help explain.&amp;nbsp; You can see that Employee 0099 has multiple months of data, with a change in Company in 8/2022.&amp;nbsp; Therefore, a "1" shows in the CoCodeChg column.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried variables, EARLIER, IF statements - all with no luck.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking forward to any ideas this group may have.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 16:34:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3093479#M108454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-22T16:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column to Flag Change in Value by Employee ID, Month Over Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3093509#M108458</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; ,New column&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Flag = var _max = maxx(filter( 'Table', 'Table'[persiD] &amp;lt; earlier( 'Table'[persiD] ) &amp;amp;&amp;amp; 'Table'[Month] &amp;lt; earlier( 'Table'[Month] )), 'Table'[Month] )&lt;BR /&gt;return &lt;BR /&gt;if( isblank(_max) || 'Table'[CoCOde] = maxx(filter( 'Table', 'Table'[persiD] &amp;lt; earlier( 'Table'[persiD] ) &amp;amp;&amp;amp; 'Table'[Month] =_month), 'Table'[CoCOde] ),0,1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI DAX- Earlier, I should have known Earlier: &lt;A href="https://youtu.be/CVW6YwvHHi8" target="_blank"&gt;https://youtu.be/CVW6YwvHHi8&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 16:48:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3093509#M108458</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-02-22T16:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column to Flag Change in Value by Employee ID, Month Over Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3093767#M108476</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;Thanks so much for your reply!&amp;nbsp; What you shared is similar to what I have tried, but your logic is definitely better than what I was coming up with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am testing it out now, but am getting an error for the&lt;STRONG&gt; = _month&lt;/STRONG&gt; near the end.&amp;nbsp; Would it be necessary to create another variable for month?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 18:28:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3093767#M108476</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-22T18:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column to Flag Change in Value by Employee ID, Month Over Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3193933#M115896</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;- can you please provide some guidance on how you would declare the _month variable?&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 14:36:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3193933#M115896</guid>
      <dc:creator>TerryBear</dc:creator>
      <dc:date>2023-04-18T14:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column to Flag Change in Value by Employee ID, Month Over Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3442277#M130800</link>
      <description>&lt;P&gt;I had to make a few changes to make this work with my data (notably I have more 'actions' than just 'job status changes' in my table).&amp;nbsp; The _month variable you're referring to is a typo - the original poster meant to reference the _max variable created in the measure.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 02:44:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3442277#M130800</guid>
      <dc:creator>AquaTard</dc:creator>
      <dc:date>2023-09-22T02:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column to Flag Change in Value by Employee ID, Month Over Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3442279#M130801</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TrackChangeFlag =&lt;/SPAN&gt; &lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_max&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;maxx&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;'Action'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Action'&lt;/SPAN&gt;&lt;SPAN&gt;[EmployeeId]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;earlier&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;'Action'&lt;/SPAN&gt;&lt;SPAN&gt;[EmployeeId]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;'Action'&lt;/SPAN&gt;&lt;SPAN&gt;[ActionId]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;earlier&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;'Action'&lt;/SPAN&gt;&lt;SPAN&gt;[ActionId]&lt;/SPAN&gt;&lt;SPAN&gt; )), &lt;/SPAN&gt;&lt;SPAN&gt;'Action'&lt;/SPAN&gt;&lt;SPAN&gt;[ActionId]&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return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t;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-- Note I set EmployeeID = instead of &amp;lt; as my data needs grouped by Employee&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Sep 2023 02:45:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-to-Flag-Change-in-Value-by-Employee-ID-Month/m-p/3442279#M130801</guid>
      <dc:creator>AquaTard</dc:creator>
      <dc:date>2023-09-22T02:45:28Z</dc:date>
    </item>
  </channel>
</rss>

