<?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: Calculate the Number of people that will be retired in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-Number-of-people-that-will-be-retired/m-p/3301489#M123159</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="579166" data-lia-user-login="Morganius" class="lia-mention lia-mention-user"&gt;Morganius&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try this meausre:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Number of retirees per company = 
var _reage=SELECTEDVALUE('Slicer 2'[Retirement Age])
var _year=SELECTEDVALUE('Slicer 1'[Number of Year])
return CALCULATE(COUNT('Table'[Name]),FILTER(ALLSELECTED('Table'),[Company]=MAX('Table'[Company])&amp;amp;&amp;amp;[Age]+_year&amp;gt;=_reage))&lt;/LI-CODE&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Stephen Tao&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2023 03:04:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-06-26T03:04:53Z</dc:date>
    <item>
      <title>Calculate the Number of people that will be retired</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-Number-of-people-that-will-be-retired/m-p/3297994#M122916</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following problem and I can not find my way out...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with the Employees information, some basic info like below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Now, based on the following 2 slicers, I would like to know whether this employee will be retired or not.&lt;/P&gt;&lt;P&gt;Slicer 1: Number of Year (0 to 10) --&amp;gt; This is the number of years in the future.&lt;/P&gt;&lt;P&gt;Slicer 2: Retirement Age (60 to 70) --&amp;gt; Age when you will get retired.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My final goal is to be able to show per Company how many people will be retired considering the selection done in the 2 previous slicers. Any thoughs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying with a measure like below but I got stucked while considering all the Ages and companies...&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is_Retired? = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; NUM_YEAR = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(years[Number of Years])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; Ret_Age = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;('Ret Age'[Retirement Age])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; Math = &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;((&lt;/SPAN&gt;&lt;SPAN&gt;Min&lt;/SPAN&gt;&lt;SPAN&gt;('Employe'[Age ]&lt;/SPAN&gt;&lt;SPAN&gt;) + NUM_YEAR - Ret_Age)&amp;gt;=&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,"YES"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"NO"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt; Math&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 14:07:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-Number-of-people-that-will-be-retired/m-p/3297994#M122916</guid>
      <dc:creator>Morganius</dc:creator>
      <dc:date>2023-06-22T14:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the Number of people that will be retired</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-Number-of-people-that-will-be-retired/m-p/3301489#M123159</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="579166" data-lia-user-login="Morganius" class="lia-mention lia-mention-user"&gt;Morganius&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try this meausre:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Number of retirees per company = 
var _reage=SELECTEDVALUE('Slicer 2'[Retirement Age])
var _year=SELECTEDVALUE('Slicer 1'[Number of Year])
return CALCULATE(COUNT('Table'[Name]),FILTER(ALLSELECTED('Table'),[Company]=MAX('Table'[Company])&amp;amp;&amp;amp;[Age]+_year&amp;gt;=_reage))&lt;/LI-CODE&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Stephen Tao&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 03:04:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-Number-of-people-that-will-be-retired/m-p/3301489#M123159</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-26T03:04:53Z</dc:date>
    </item>
  </channel>
</rss>

