<?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: Average monthly salary by employee in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2989340#M100510</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please have a try.&lt;/P&gt;
&lt;P&gt;Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;measure== var _a = 'table'[avg]
var _b = SUMMARIZE('table','table'[date],"aaa",'table'[avg])
return
IF(HASONEVALUE('table'[date]),_a,averagex(_b,[aaa]))&lt;/LI-CODE&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;Best Regards&lt;BR /&gt;Community Support Team _ Polly&lt;BR /&gt;&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Dec 2022 01:41:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-27T01:41:48Z</dc:date>
    <item>
      <title>Average monthly salary by employee</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2988854#M100471</link>
      <description>&lt;P&gt;Hello everyone&lt;/P&gt;&lt;P&gt;As you all know, the salary is a set of codes for each month and person, right? Like the salary, food allowance,&amp;nbsp;productivity allowance, etc.&lt;BR /&gt;I would like to know the average of the salary only for each person, each month, of a particular year.&amp;nbsp; And this measeure would work if every month had values, which it does not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Avg salary By Year &amp;amp; Employee = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;'Dates'&lt;/SPAN&gt;&lt;SPAN&gt;[MonthOfYear]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;'Employee'&lt;/SPAN&gt;&lt;SPAN&gt;[WorkerName]&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[Salary]&lt;/SPAN&gt;&lt;SPAN&gt;))&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(this measure is a simple one that calculates a sum of a value filtered by the code of the salary name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;As an example, this worker have worked for 8 months in 2021 but only 3 months had values in the salary item. The other 5 months had values in other items diffferent than salary.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It's showing me the average of 540 but it should be 1440.&lt;BR /&gt;Could you please help me?&lt;BR /&gt;Thanks in advance&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 26 Dec 2022 13:27:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2988854#M100471</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-12-26T13:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Average monthly salary by employee</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2988861#M100472</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt; , Try like &lt;/P&gt;
&lt;P&gt;Avg salary By Year &amp;amp; Employee =&lt;BR /&gt;var _calc = AVERAGEX(&lt;BR /&gt;VALUES( 'Employee'[WorkerName] ),&lt;BR /&gt;[Salary])&lt;BR /&gt;return &lt;BR /&gt;AVERAGEX(filter( &lt;BR /&gt;VALUES( 'Dates'[MonthOfYear]) , _calc &amp;lt;&amp;gt; 0 ),_calc)&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 13:43:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2988861#M100472</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-12-26T13:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Average monthly salary by employee</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2988940#M100485</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&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;&lt;BR /&gt;Thank you for your answer.&lt;BR /&gt;I think you've manage to filter the non salary values,&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;But instead of the average it's showing the total.&lt;BR /&gt;I thought it would be enough to replace the VALUES function but not.&amp;nbsp;&lt;BR /&gt;Can you still help me?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 14:37:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2988940#M100485</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-12-26T14:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Average monthly salary by employee</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2989340#M100510</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please have a try.&lt;/P&gt;
&lt;P&gt;Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;measure== var _a = 'table'[avg]
var _b = SUMMARIZE('table','table'[date],"aaa",'table'[avg])
return
IF(HASONEVALUE('table'[date]),_a,averagex(_b,[aaa]))&lt;/LI-CODE&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;Best Regards&lt;BR /&gt;Community Support Team _ Polly&lt;BR /&gt;&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 01:41:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2989340#M100510</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-27T01:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Average monthly salary by employee</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2989905#M100544</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; !!&lt;BR /&gt;I'm sorry but I don't understand this. Could you explain?&lt;/P&gt;&lt;PRE&gt;var _a = 'table'[avg]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 19:39:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2989905#M100544</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-12-27T19:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Average monthly salary by employee</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2990875#M100619</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt;&amp;nbsp;，&lt;/P&gt;
&lt;PRE&gt;var _a = 'table'[avg]&lt;/PRE&gt;
&lt;P&gt;This is the measure you created before.&lt;/P&gt;
&lt;P&gt;I have created a simple sample , please refer to it to see if it helps you.&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;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team _ Polly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 01:25:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-monthly-salary-by-employee/m-p/2990875#M100619</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-28T01:25:20Z</dc:date>
    </item>
  </channel>
</rss>

