<?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 Payroll Changes monthly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Payroll-Changes-monthly/m-p/4163955#M165418</link>
    <description>&lt;P&gt;I have created a dax measure to calculate payroll changes monthly&amp;nbsp;&lt;BR /&gt;here is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Earning Change Previous Month = 
VAR SelectedDate = SELECTEDVALUE('PayStatementEarningLineInquiries'[PeriodStartDate])
VAR SelectedYear = YEAR(SelectedDate)
VAR SelectedMonth = MONTH(SelectedDate)

-- Determine the previous month
VAR PreviousMonthStartDate = 
    IF(
        SelectedMonth = 1,
        DATE(SelectedYear - 1, 12, 1),
        DATE(SelectedYear, SelectedMonth - 1, 1)
    )

VAR PreviousMonthEndDate = 
    IF(
        SelectedMonth = 1,
        EOMONTH(DATE(SelectedYear - 1, 12, 1), 0),
        EOMONTH(DATE(SelectedYear, SelectedMonth - 1, 1), 0)
    )

-- Determine the current month
VAR CurrentMonthStartDate = DATE(SelectedYear, SelectedMonth, 1)
VAR CurrentMonthEndDate = EOMONTH(CurrentMonthStartDate, 0)

-- Calculate Total Earnings for the Previous Month
VAR PreviousMonthEarnings = 
    CALCULATE(
        [TotalEarning meas],
        ALLEXCEPT(
            PayStatementEarningLineInquiries, 
            PayStatementEarningLineInquiries[Worker]
        ),
        '(PayStatementHeaders)'[PeriodStartDate] &amp;gt;= PreviousMonthStartDate,
        '(PayStatementHeaders)'[PeriodStartDate] &amp;lt;= PreviousMonthEndDate
    )

-- Calculate Total Earnings for the Current Month
VAR CurrentMonthEarnings = 
    CALCULATE(
        [TotalEarning meas],
        ALLEXCEPT(
            'PayStatementEarningLineInquiries', 
            'PayStatementEarningLineInquiries'[Worker]
        ),
        '(PayStatementHeaders)'[PeriodStartDate] &amp;gt;= CurrentMonthStartDate,
        '(PayStatementHeaders)'[PeriodStartDate] &amp;lt;= CurrentMonthEndDate
    )

RETURN
    CurrentMonthEarnings - PreviousMonthEarnings
    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;this measure give me all total changes between month&amp;nbsp;&lt;BR /&gt;How can I found :&lt;BR /&gt;1 - Total salary of new Employement in current month&amp;nbsp;&lt;BR /&gt;2 - Total salary increases for employees between current month and previous month (not new employees)&lt;BR /&gt;&amp;nbsp;3- Total salary decreases for employees&amp;nbsp; between current month and previous month (not new employees)&lt;BR /&gt;&lt;BR /&gt;I want each of them on separate measures , can anyone help me ?&lt;/P&gt;</description>
    <pubDate>Sat, 21 Sep 2024 12:42:23 GMT</pubDate>
    <dc:creator>amal_01</dc:creator>
    <dc:date>2024-09-21T12:42:23Z</dc:date>
    <item>
      <title>Payroll Changes monthly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Payroll-Changes-monthly/m-p/4163955#M165418</link>
      <description>&lt;P&gt;I have created a dax measure to calculate payroll changes monthly&amp;nbsp;&lt;BR /&gt;here is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Earning Change Previous Month = 
VAR SelectedDate = SELECTEDVALUE('PayStatementEarningLineInquiries'[PeriodStartDate])
VAR SelectedYear = YEAR(SelectedDate)
VAR SelectedMonth = MONTH(SelectedDate)

-- Determine the previous month
VAR PreviousMonthStartDate = 
    IF(
        SelectedMonth = 1,
        DATE(SelectedYear - 1, 12, 1),
        DATE(SelectedYear, SelectedMonth - 1, 1)
    )

VAR PreviousMonthEndDate = 
    IF(
        SelectedMonth = 1,
        EOMONTH(DATE(SelectedYear - 1, 12, 1), 0),
        EOMONTH(DATE(SelectedYear, SelectedMonth - 1, 1), 0)
    )

-- Determine the current month
VAR CurrentMonthStartDate = DATE(SelectedYear, SelectedMonth, 1)
VAR CurrentMonthEndDate = EOMONTH(CurrentMonthStartDate, 0)

-- Calculate Total Earnings for the Previous Month
VAR PreviousMonthEarnings = 
    CALCULATE(
        [TotalEarning meas],
        ALLEXCEPT(
            PayStatementEarningLineInquiries, 
            PayStatementEarningLineInquiries[Worker]
        ),
        '(PayStatementHeaders)'[PeriodStartDate] &amp;gt;= PreviousMonthStartDate,
        '(PayStatementHeaders)'[PeriodStartDate] &amp;lt;= PreviousMonthEndDate
    )

-- Calculate Total Earnings for the Current Month
VAR CurrentMonthEarnings = 
    CALCULATE(
        [TotalEarning meas],
        ALLEXCEPT(
            'PayStatementEarningLineInquiries', 
            'PayStatementEarningLineInquiries'[Worker]
        ),
        '(PayStatementHeaders)'[PeriodStartDate] &amp;gt;= CurrentMonthStartDate,
        '(PayStatementHeaders)'[PeriodStartDate] &amp;lt;= CurrentMonthEndDate
    )

RETURN
    CurrentMonthEarnings - PreviousMonthEarnings
    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;this measure give me all total changes between month&amp;nbsp;&lt;BR /&gt;How can I found :&lt;BR /&gt;1 - Total salary of new Employement in current month&amp;nbsp;&lt;BR /&gt;2 - Total salary increases for employees between current month and previous month (not new employees)&lt;BR /&gt;&amp;nbsp;3- Total salary decreases for employees&amp;nbsp; between current month and previous month (not new employees)&lt;BR /&gt;&lt;BR /&gt;I want each of them on separate measures , can anyone help me ?&lt;/P&gt;</description>
      <pubDate>Sat, 21 Sep 2024 12:42:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Payroll-Changes-monthly/m-p/4163955#M165418</guid>
      <dc:creator>amal_01</dc:creator>
      <dc:date>2024-09-21T12:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Payroll Changes monthly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Payroll-Changes-monthly/m-p/4164167#M165425</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Sep 2024 15:55:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Payroll-Changes-monthly/m-p/4164167#M165425</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-09-21T15:55:35Z</dc:date>
    </item>
  </channel>
</rss>

