<?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: How to compute the yearly salary spendings/costs in DAX? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3128928#M111246</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot for your reply and the link you provided. An entertaining rant on Calculate &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately my starting point is a bit different from the example in your video.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all, I don't have the values ( in my case monthly salary) per each month.I just have it one time in the table per employee (EmpID).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I need to consider&amp;nbsp; if&amp;nbsp; a person ( based on their Hire or Term Date) is still employeed in a specific year and if so how many month.&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;May you have an idea to solve my issue?&lt;/P&gt;&lt;H1&gt;&lt;SPAN class=""&gt;"How to compute the yearly salary spendings/costs in DAX?"&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Martin &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2023 18:29:21 GMT</pubDate>
    <dc:creator>Mar82</dc:creator>
    <dc:date>2023-03-13T18:29:21Z</dc:date>
    <item>
      <title>How to compute the yearly salary spendings/costs in DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3127035#M111097</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a part of a Power BI HR Dashboard, I want to showcase the yearly salary costs in a card visual as a rolling total per year. How I can transfer this to DAX code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;1. Result to achieve:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Example: Test data for year 2018:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;H2&gt;&lt;STRONG&gt;Card content&lt;/STRONG&gt;&lt;/H2&gt;&lt;P&gt;Cost of Salary per certain year&lt;/P&gt;&lt;P&gt;32.000 €&lt;/P&gt;&lt;P&gt;Option to change specific year by slicer on Date Table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Columns to work with in fact table&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;EmpID&lt;/LI&gt;&lt;LI&gt;Salary&lt;/LI&gt;&lt;LI&gt;DateofHire&lt;/LI&gt;&lt;LI&gt;TermDate&lt;/LI&gt;&lt;LI&gt;SalaryMonthly&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H1&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;2. Things to consider:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H1&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Employee, who was hired before a certain year and is active till end of certain year. Salary spendings needs to be calculated over all month of year (EmpID: 1).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Employee, who was hired before certain year and is terminated inside certain year. Salary needs to be calculated just for active months (EmpID: 4).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Employee, who was hired in certain year and is active till end of certain year (EmpID: 3).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Employee, who was hired in certain year and is terminated inside certain year (EmpID: 2).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H1&gt;&lt;FONT size="5"&gt;3. Data Model&lt;/FONT&gt;&lt;/H1&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;H2&gt;&lt;FONT size="5"&gt;3.1 Relationships&lt;/FONT&gt;&lt;/H2&gt;&lt;P&gt;Date Table &amp;amp; Fact table is connected via inactive relationships&lt;/P&gt;&lt;P&gt;‘Date’[Date] 1-&amp;gt;* ‘Fact’[DateofHire]&lt;/P&gt;&lt;P&gt;‘Date’[Date] 1-&amp;gt;* ‘Fact’[TermDate]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;4. Data Set&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!ApbrVj8RZyxnkWev_fGDrZQdMhls?e=K3hPy5" target="_blank" rel="noopener"&gt;https://1drv.ms/u/s!ApbrVj8RZyxnkWev_fGDrZQdMhls?e=K3hPy5&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate, if someone can help me out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:14:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3127035#M111097</guid>
      <dc:creator>Mar82</dc:creator>
      <dc:date>2023-03-13T07:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute the yearly salary spendings/costs in DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3127282#M111121</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="528180" data-lia-user-login="Mar82" class="lia-mention lia-mention-user"&gt;Mar82&lt;/a&gt;&amp;nbsp;Try this:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/2755666#M885" target="_blank"&gt;(1) Better Running Total - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 08:29:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3127282#M111121</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-03-13T08:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute the yearly salary spendings/costs in DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3128928#M111246</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot for your reply and the link you provided. An entertaining rant on Calculate &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately my starting point is a bit different from the example in your video.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all, I don't have the values ( in my case monthly salary) per each month.I just have it one time in the table per employee (EmpID).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I need to consider&amp;nbsp; if&amp;nbsp; a person ( based on their Hire or Term Date) is still employeed in a specific year and if so how many month.&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;May you have an idea to solve my issue?&lt;/P&gt;&lt;H1&gt;&lt;SPAN class=""&gt;"How to compute the yearly salary spendings/costs in DAX?"&lt;/SPAN&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Martin &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 18:29:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3128928#M111246</guid>
      <dc:creator>Mar82</dc:creator>
      <dc:date>2023-03-13T18:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute the yearly salary spendings/costs in DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3129091#M111262</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="528180" data-lia-user-login="Mar82" class="lia-mention lia-mention-user"&gt;Mar82&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;assuming both relationships are inactive, you may try&lt;/P&gt;
&lt;P&gt;Salary Amounts =&lt;BR /&gt;VAR MinDate =&lt;BR /&gt;MIN ( 'Date'[Date] )&lt;BR /&gt;VAR MaxDate =&lt;BR /&gt;MAX ( 'Date'[Date] )&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX (&lt;BR /&gt;FILTER ( 'Fact', 'Fact'[DateofHire] &amp;lt;= MaxDate &amp;amp;&amp;amp; 'Fact'[TermDate] &amp;gt;= MinDate ),&lt;BR /&gt;'Fact'[SalaryMonthly]&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 19:46:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3129091#M111262</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-13T19:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute the yearly salary spendings/costs in DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3129898#M111308</link>
      <description>&lt;P&gt;Hi&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your answer. I have added a FILTER argument to include also the Blanks for 'Fact'[TermDate].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Salary Amount :=&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; VAR MinDate = MIN('Date'[Date])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; VAR MaxDate = MAX('Date'[Date])&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SUMX(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Fact',&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Fact'[DateofHire] &amp;lt;= MaxDate &amp;amp;&amp;amp; 'Fact'[TermDate] &amp;gt;= MinDate ||&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Fact'[DateofHire] &amp;lt;= MaxDate &amp;amp;&amp;amp; 'Fact'[TermDate]=BLANK()&amp;nbsp; // including TermDate Blanks //&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Fact'[SalaryMonthly]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I just have a&amp;nbsp; single value for column [SalaryMonthly] per each employee even the person is employed multiple months.&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a result, the [Salary Amount] for e.g. a certain year is computed as if all the employees would have get just one single monthly salary paid out in that specific year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How I can solve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Martin&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 06:04:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3129898#M111308</guid>
      <dc:creator>Mar82</dc:creator>
      <dc:date>2023-03-14T06:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute the yearly salary spendings/costs in DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3129930#M111310</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="528180" data-lia-user-login="Mar82" class="lia-mention lia-mention-user"&gt;Mar82&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;This has to be a measure. It cannot be a calculated column. Please refer to attached amended sample file.&lt;/P&gt;
&lt;P&gt;To handle blanks please use&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Salary Amounts = 
SUMX (
    VALUES ( 'Date'[Year Month] ),
    VAR MinDate = CALCULATE ( MIN ( 'Date'[Date] ) )
    VAR MaxDate = CALCULATE ( MAX ( 'Date'[Date] ) )
    RETURN
        SUMX (
            FILTER ( 'Kaggle', 'Kaggle'[DateofHire] &amp;lt;= MaxDate &amp;amp;&amp;amp; COALESCE ( 'Kaggle'[TermDate], TODAY ( ) ) &amp;gt;= MinDate ),
            'Kaggle'[SalaryMonthly]
        )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 06:22:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3129930#M111310</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-14T06:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute the yearly salary spendings/costs in DAX?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3129965#M111313</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really nice, now I got the card I wanted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 06:47:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compute-the-yearly-salary-spendings-costs-in-DAX/m-p/3129965#M111313</guid>
      <dc:creator>Mar82</dc:creator>
      <dc:date>2023-03-14T06:47:31Z</dc:date>
    </item>
  </channel>
</rss>

