<?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: Date of last change in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414630#M190332</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="16329" data-lia-user-login="Birdjo" class="lia-mention lia-mention-user"&gt;Birdjo&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this revision&lt;/P&gt;&lt;P&gt;See the attached file as well&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;New Table =
VAR temp =
    ADDCOLUMNS (
        ADDCOLUMNS (
            Table1,
            "PreviousSalary",
            VAR Previous_Date =
                CALCULATE (
                    MAX ( Table1[Date] ),
                    FILTER (
                        ALLEXCEPT ( Table1, Table1[Employee] ),
                        Table1[Date] &amp;lt; EARLIER ( Table1[Date] )
                            &amp;amp;&amp;amp; Table1[Event] = "Salary"
                    )
                )
            RETURN
                IF (
                    Table1[Event] = "Salary",
                    CALCULATE (
                        SUM ( Table1[Salary] ),
                        FILTER (
                            ALLEXCEPT ( Table1, Table1[Employee] ),
                            Table1[Date] = Previous_Date
                                &amp;amp;&amp;amp; Table1[Event] = "Salary"
                        )
                    )
                )
        ),
        "% increase", Table1[Salary] / [PreviousSalary]
            - 1
    )
VAR temp2 =
    FILTER ( temp, NOT [% increase] IN { 0, 1 / 0 } )
VAR temp3 =
    ADDCOLUMNS (
        temp2,
        "Maxdate", CALCULATE (
            MAX ( Table1[Date] ),
            FILTER (
                temp2,
                Table1[Employee] = EARLIER ( Table1[Employee] )
                    &amp;amp;&amp;amp; Table1[Event] = "Salary"
            )
        )
    )
RETURN
    FILTER ( temp3, [Date] = [Maxdate] )&lt;/PRE&gt;</description>
    <pubDate>Thu, 10 May 2018 11:07:21 GMT</pubDate>
    <dc:creator>Zubair_Muhammad</dc:creator>
    <dc:date>2018-05-10T11:07:21Z</dc:date>
    <item>
      <title>Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/413391#M189788</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for a solution for my employees' salary analyses report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got stuck visualizing the date of the last change (increase) of the following dataset:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to achieve is the following table:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank's in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 06:31:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/413391#M189788</guid>
      <dc:creator>Birdjo</dc:creator>
      <dc:date>2018-05-09T06:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/413536#M189872</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="16329" data-lia-user-login="Birdjo" class="lia-mention lia-mention-user"&gt;Birdjo&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One way could be a new calculated table&lt;/P&gt;&lt;P&gt;From the Modelling Tab &amp;gt;&amp;gt;&amp;gt;New Table&lt;/P&gt;&lt;P&gt;(Assuming your Table Name is Table1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;New Table =
VAR temp =
    ADDCOLUMNS (
        ADDCOLUMNS (
            Table1,
            "PreviousSalary",
            VAR Previous_Date =
                CALCULATE (
                    MAX ( Table1[Date] ),
                    FILTER (
                        ALLEXCEPT ( Table1, Table1[Employee] ),
                        Table1[Date] &amp;lt; EARLIER ( Table1[Date] )
                    )
                )
            RETURN
                CALCULATE (
                    SUM ( Table1[Salary] ),
                    FILTER ( ALLEXCEPT ( Table1, Table1[Employee] ), Table1[Date] = Previous_Date )
                )
        ),
        "% increase", Table1[Salary] / [PreviousSalary]
            - 1
    )
VAR temp2 =
    FILTER ( temp, NOT [% increase] IN { 0, 1 / 0 } )
VAR temp3 =
    ADDCOLUMNS (
        temp2,
        "Maxdate", CALCULATE (
            MAX ( Table1[Date] ),
            FILTER ( temp2, Table1[Employee] = EARLIER ( Table1[Employee] ) )
        )
    )
VAR Final_Table =
    FILTER ( temp3, [Date] = [Maxdate] )
RETURN
    Final_Table&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 08:29:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/413536#M189872</guid>
      <dc:creator>Zubair_Muhammad</dc:creator>
      <dc:date>2018-05-09T08:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/413542#M189875</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="16329" data-lia-user-login="Birdjo" class="lia-mention lia-mention-user"&gt;Birdjo&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see attached file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 08:31:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/413542#M189875</guid>
      <dc:creator>Zubair_Muhammad</dc:creator>
      <dc:date>2018-05-09T08:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/413962#M190053</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="16329" data-lia-user-login="Birdjo" class="lia-mention lia-mention-user"&gt;Birdjo&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,Let me try with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add a Calculated Column in your Salary Table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming you have Every Month Salary of the Employees.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Variation =
DIVIDE (
    Salary[Salary]
        - CALCULATE (
            MAX ( Salary[Salary] );
            FILTER ( Salary; Salary[Employee] = EARLIER ( Salary[Employee] ) );
            DATEADD ( Salary[Date]; -1; MONTH )
        );
    CALCULATE (
        MAX ( Salary[Salary] );
        FILTER ( Salary; Salary[Employee] = EARLIER ( Salary[Employee] ) );
        DATEADD ( Salary[Date]; -1; MONTH )
    )
)&lt;/PRE&gt;&lt;P&gt;Now, create the measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;LastChange = CALCULATE(Max(Salary[Date]);FILTER(Salary;Salary[Variation]&amp;lt;&amp;gt;0 ))&lt;/PRE&gt;&lt;PRE&gt;MSalary =
VAR LCHANGE = [LastChange]
RETURN
    CALCULATE ( MAX ( Salary[Salary] ); FILTER ( Salary; Salary[Date] = LCHANGE ) )&lt;/PRE&gt;&lt;PRE&gt;M%&amp;amp;Var =
VAR LCHANGE = [LastChange]
RETURN
    CALCULATE (
        MAX ( Salary[Variation] );
        FILTER ( Salary; Salary[Date] = LCHANGE )
    )&lt;/PRE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 16:34:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/413962#M190053</guid>
      <dc:creator>Vvelarde</dc:creator>
      <dc:date>2018-05-09T16:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414391#M190237</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You requirement can be achieved through dynamic Measures... which you can modify in a later stage..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also addition another column for you ease .. to seee "Previous Salary"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe the &lt;STRONG&gt;change % should be wrt to last salary (not wrt latest salary )&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution pics are mentioend belwo.... Hope you enjoyed it...&lt;/P&gt;&lt;P&gt;Please tick as ans if the solution BAMMED ur prob :D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have incorporated all VAR in on measure for your ease&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 06:50:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414391#M190237</guid>
      <dc:creator>afzalphatan</dc:creator>
      <dc:date>2018-05-10T06:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414412#M190243</link>
      <description>&lt;P&gt;Thanks everybody!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I tested the calculated table and it works fine. However seems like my data isn't that clean and there are some changes in the salaries which are not raises. There 1 month increases such as bonuses and some 1 month decreases in some cases.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I like the calculated column solution although I didn't try it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is more realistic look of my data. The last column called "Event" is something that I wrote manually.&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case the formulas return the last change date as 01.10.2017, however a person can identify that the last raise was on 01.08.2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems like this case is a serious challenge.&lt;BR /&gt;Do you have any ideas how to resolve it?&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 07:11:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414412#M190243</guid>
      <dc:creator>Birdjo</dc:creator>
      <dc:date>2018-05-10T07:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414630#M190332</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="16329" data-lia-user-login="Birdjo" class="lia-mention lia-mention-user"&gt;Birdjo&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this revision&lt;/P&gt;&lt;P&gt;See the attached file as well&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;New Table =
VAR temp =
    ADDCOLUMNS (
        ADDCOLUMNS (
            Table1,
            "PreviousSalary",
            VAR Previous_Date =
                CALCULATE (
                    MAX ( Table1[Date] ),
                    FILTER (
                        ALLEXCEPT ( Table1, Table1[Employee] ),
                        Table1[Date] &amp;lt; EARLIER ( Table1[Date] )
                            &amp;amp;&amp;amp; Table1[Event] = "Salary"
                    )
                )
            RETURN
                IF (
                    Table1[Event] = "Salary",
                    CALCULATE (
                        SUM ( Table1[Salary] ),
                        FILTER (
                            ALLEXCEPT ( Table1, Table1[Employee] ),
                            Table1[Date] = Previous_Date
                                &amp;amp;&amp;amp; Table1[Event] = "Salary"
                        )
                    )
                )
        ),
        "% increase", Table1[Salary] / [PreviousSalary]
            - 1
    )
VAR temp2 =
    FILTER ( temp, NOT [% increase] IN { 0, 1 / 0 } )
VAR temp3 =
    ADDCOLUMNS (
        temp2,
        "Maxdate", CALCULATE (
            MAX ( Table1[Date] ),
            FILTER (
                temp2,
                Table1[Employee] = EARLIER ( Table1[Employee] )
                    &amp;amp;&amp;amp; Table1[Event] = "Salary"
            )
        )
    )
RETURN
    FILTER ( temp3, [Date] = [Maxdate] )&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 May 2018 11:07:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414630#M190332</guid>
      <dc:creator>Zubair_Muhammad</dc:creator>
      <dc:date>2018-05-10T11:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414696#M190360</link>
      <description>&lt;P&gt;I'm sorry I didn't made it clear. The [Event] column is something I write manually just to demonstrate how changes could be something different than a raise. I don't have [Event] column in the original dataset.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 13:06:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414696#M190360</guid>
      <dc:creator>Birdjo</dc:creator>
      <dc:date>2018-05-10T13:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414714#M190369</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="16329" data-lia-user-login="Birdjo" class="lia-mention lia-mention-user"&gt;Birdjo&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gets really tough then :smileytongue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if we add a calculated column to get the "Event" column&lt;/P&gt;&lt;P&gt;I mean a salary would exist at least 2 or 3 times for an employee...while bonus and raise might be unique figures for one employee&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So a calculated column like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Event =
VAR myCount =
    CALCULATE (
        COUNTROWS ( Table1 ),
        ALLEXCEPT ( Table1, Table1[Employee], Table1[Salary] )
    )
RETURN
    IF ( myCount &amp;gt; 1, "Salary", "Others" )&lt;/PRE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 13:27:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414714#M190369</guid>
      <dc:creator>Zubair_Muhammad</dc:creator>
      <dc:date>2018-05-10T13:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414759#M190392</link>
      <description>&lt;P&gt;It is really tough indeed. :D&lt;BR /&gt;&lt;BR /&gt;That's clever but what if the same bonus occurs two times or the raise was in the last month?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is easy for a human to decide whether it is a raise or something else, however recreating this thought process with DAX seems hard to me.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 14:13:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414759#M190392</guid>
      <dc:creator>Birdjo</dc:creator>
      <dc:date>2018-05-10T14:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date of last change</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414794#M190409</link>
      <description>&lt;P&gt;I have some progress with this case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the employee salaries as in their contract. So bonuses are not included there. Only raises and very slight increases and decreases like -2% to +2%.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I decided to use&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="42973" data-lia-user-login="Zubair_Muhammad" class="lia-mention lia-mention-user"&gt;Zubair_Muhammad&lt;/a&gt;'s solution with the calculated table as the other one doesn't behave well because it looks for MAX(Table1[Salary])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any ideas how to implement some treshold in it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 14:40:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Date-of-last-change/m-p/414794#M190409</guid>
      <dc:creator>Birdjo</dc:creator>
      <dc:date>2018-05-10T14:40:09Z</dc:date>
    </item>
  </channel>
</rss>

