<?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 Tenure Calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tenure-Calculation/m-p/3747230#M146154</link>
    <description>&lt;P&gt;I am trying to calculate tenure and I believe my Dax is right because when I use my slicers to pick out an individual, for example myself, the calculation is correct. Yet when it is aggregated and takes into account the enitre employee populatiuon, it is off by like .5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my dax&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Average Tenure (Years) =&lt;/SPAN&gt; &lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'1'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'1'&lt;/SPAN&gt;&lt;SPAN&gt;[Hire Date]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And the way I am doing outside of BI is the following&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Days between start date and end date&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Days /365.25&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone have any insight? Happy to share more &lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 06 Mar 2024 23:05:30 GMT</pubDate>
    <dc:creator>GMireles</dc:creator>
    <dc:date>2024-03-06T23:05:30Z</dc:date>
    <item>
      <title>Tenure Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tenure-Calculation/m-p/3747230#M146154</link>
      <description>&lt;P&gt;I am trying to calculate tenure and I believe my Dax is right because when I use my slicers to pick out an individual, for example myself, the calculation is correct. Yet when it is aggregated and takes into account the enitre employee populatiuon, it is off by like .5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my dax&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Average Tenure (Years) =&lt;/SPAN&gt; &lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'1'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'1'&lt;/SPAN&gt;&lt;SPAN&gt;[Hire Date]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And the way I am doing outside of BI is the following&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Days between start date and end date&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Days /365.25&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone have any insight? Happy to share more &lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Mar 2024 23:05:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tenure-Calculation/m-p/3747230#M146154</guid>
      <dc:creator>GMireles</dc:creator>
      <dc:date>2024-03-06T23:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Tenure Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tenure-Calculation/m-p/3747549#M146163</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="697374" data-lia-user-login="GMireles" class="lia-mention lia-mention-user"&gt;GMireles&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Since you divided by 365.25 in the manual calculation to account for leap years, you can modify the DAX formula to first calculate the number of days and then convert it to years by dividing by 365.25. This may help reduce the differences.&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Average Tenure (Years) =
AVERAGEX(
'1',
DATEDIFF('1'[Hire Date], TODAY(), DAY) / 365.25
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your Current Period does not refer to this, please clarify in a follow-up reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Clara Gong&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 02:50:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tenure-Calculation/m-p/3747549#M146163</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-07T02:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Tenure Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tenure-Calculation/m-p/3749173#M146235</link>
      <description>&lt;P&gt;I was definitely overthinking it!! Thank you&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 15:29:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Tenure-Calculation/m-p/3749173#M146235</guid>
      <dc:creator>GMireles</dc:creator>
      <dc:date>2024-03-07T15:29:07Z</dc:date>
    </item>
  </channel>
</rss>

