<?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 Issue in writing DAX measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-in-writing-DAX-measure/m-p/2987196#M100307</link>
    <description>&lt;P&gt;Can you please help me to write dynamic DAX measure? I have the date and training validity column in a table. If the date is within that 2 years or 3 years training validity it should show the training status as "completed" if it exceeds 2 years or 3 years it should show the training status as "not completed" I want to know what is the count of training status "completed" and "not completed" during a given period and categorize them meanwhile I have to use TODAY() function in that measure I am using a date in a slicer and by changing the date, I can change the training validity in that given period.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for any given any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Training Validity&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Training Status&amp;nbsp;&lt;/P&gt;&lt;P&gt;10-Jan-20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;20-Jan-20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;21-Jul-20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;21-Mar-20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;22-Mar-21.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;2-Apr-21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;3-Apr-21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;</description>
    <pubDate>Fri, 23 Dec 2022 20:47:30 GMT</pubDate>
    <dc:creator>Anony_mous</dc:creator>
    <dc:date>2022-12-23T20:47:30Z</dc:date>
    <item>
      <title>Issue in writing DAX measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-in-writing-DAX-measure/m-p/2987196#M100307</link>
      <description>&lt;P&gt;Can you please help me to write dynamic DAX measure? I have the date and training validity column in a table. If the date is within that 2 years or 3 years training validity it should show the training status as "completed" if it exceeds 2 years or 3 years it should show the training status as "not completed" I want to know what is the count of training status "completed" and "not completed" during a given period and categorize them meanwhile I have to use TODAY() function in that measure I am using a date in a slicer and by changing the date, I can change the training validity in that given period.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for any given any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Training Validity&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Training Status&amp;nbsp;&lt;/P&gt;&lt;P&gt;10-Jan-20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;20-Jan-20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;21-Jul-20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;21-Mar-20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;22-Mar-21.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;2-Apr-21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;3-Apr-21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 20:47:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-in-writing-DAX-measure/m-p/2987196#M100307</guid>
      <dc:creator>Anony_mous</dc:creator>
      <dc:date>2022-12-23T20:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in writing DAX measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-in-writing-DAX-measure/m-p/2987297#M100319</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490834" data-lia-user-login="Anony_mous" class="lia-mention lia-mention-user"&gt;Anony_mous&lt;/a&gt;&amp;nbsp;Maybe:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Training Status Measure =
  VAR __Date = MAX('Table'[Date])
  VAR __Years = MAX('Table'[Training Validity])
  VAR __ValidTil = DATE(YEAR(__Date) + __Years, MONTH(__Date), DAY(__Date))
  VAR __Result = IF(__ValidTil &amp;gt;= TODAY(), "completed", "not completed")
RETURN
  __Result&lt;/LI-CODE&gt;
&lt;P&gt;If it is OK if it is valid until the end of the month then you could do this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Training Status Measure =
  VAR __Date = MAX('Table'[Date])
  VAR __Years = MAX('Table'[Training Validity])
  VAR __ValidTil = EOMONTH(__Date, -12 * __Years)
  VAR __Result = IF(__ValidTil &amp;gt;= TODAY(), "completed", "not completed")
RETURN
  __Result&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 23 Dec 2022 23:37:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-in-writing-DAX-measure/m-p/2987297#M100319</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-12-23T23:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in writing DAX measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-in-writing-DAX-measure/m-p/2991023#M100636</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490834" data-lia-user-login="Anony_mous" class="lia-mention lia-mention-user"&gt;Anony_mous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Approve with&amp;nbsp;&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;, You can calculate the training status by using these DAX.&lt;/P&gt;
&lt;P&gt;However, You said "&lt;SPAN&gt;I am using a date in a slicer and by changing the date, I can change the training validity in that given period"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What does it mean? What is a given period and how to change the training validity?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after&amp;nbsp;&lt;STRONG&gt;removing sensitive data.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Refer to:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7Cv-jianboli%40microsoft.com%7Ca7ce12be0f454896a61208da8034281b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637963258750159993%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=orVyE0%2FImc2MEFUqXtCveK0uf33594f67ZDxb8ybuNI%3D&amp;amp;reserved=0" target="_blank"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7Cv-jianboli%40microsoft.com%7Ca7ce12be0f454896a61208da8034281b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637963258750159993%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=XocTq9o6TjxbxJqTak20E3kKp7q5HxKTNZef7xESMV0%3D&amp;amp;reserved=0" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 03:08:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-in-writing-DAX-measure/m-p/2991023#M100636</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-12-28T03:08:47Z</dc:date>
    </item>
  </channel>
</rss>

