<?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: Using DAX for converting dates to status categories in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3970421#M153988</link>
    <description>&lt;P&gt;Thank you again for your help! The first if-statement needed a slight modification, as it interpreted a blank cell as 0, therefore giving all blank cells the output 'urgent action required'. I have added an 'is not blank' statement to that line and now it works perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IsCalibrationDue = 

IF (  [calibration_due]  &amp;lt;= TODAY() &amp;amp;&amp;amp; NOT(ISBLANK([calibration_due])), "Urgent Action Required",
IF (  [calibration_due]  &amp;gt;= EDATE(TODAY(), 3), "OK",
IF (  [calibration_due] &amp;gt; TODAY() &amp;amp;&amp;amp; [calibration_due] &amp;lt; EDATE(TODAY(), 3), "Set up new Calibration",
IF ( [calibration_due] = BLANK(), "Set Up Calibration Date"))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jun 2024 06:39:51 GMT</pubDate>
    <dc:creator>oliverome</dc:creator>
    <dc:date>2024-06-04T06:39:51Z</dc:date>
    <item>
      <title>Using DAX for converting dates to status categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3968683#M153907</link>
      <description>&lt;P&gt;Hi all, I have a question about using DAX to convert dates into a corresponding status.&lt;/P&gt;&lt;P&gt;I have a column with calibration due dates for some equipment. There are a few possibilities:&lt;/P&gt;&lt;P&gt;- The equipment has a date 4 or more months in the future. All is good.&amp;nbsp;&lt;/P&gt;&lt;P&gt;- The equipment has a date less than 4 months in the future. I need to set up a new calibration.&lt;/P&gt;&lt;P&gt;- The equipment has a date in the past. This is not good, urgent action is needed.&lt;/P&gt;&lt;P&gt;- The cell is blank. There is no information available on the calibration due date. Also not good, but a different kind of action is needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I write DAX code to make this distinction?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried this, for example:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IsCalibrationDue =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&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;[calibration_due]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;() || &lt;/SPAN&gt;&lt;SPAN&gt;[calibration_due]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;EOMONTH&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;4&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;TRUE&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;FALSE&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This returns True if a cell is blank, or the calibration date is in the past or within the next 4 months. False if the date is further in the future. But that's not all I need. I need more categories, but I can't figure it out.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Can you help me? I am new to Power BI and DAX, so I'd really appreciate it.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 03 Jun 2024 12:34:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3968683#M153907</guid>
      <dc:creator>oliverome</dc:creator>
      <dc:date>2024-06-03T12:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using DAX for converting dates to status categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3968837#M153911</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="688820" data-lia-user-login="oliverome" class="lia-mention lia-mention-user"&gt;oliverome&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please try the following&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;LI-CODE lang="markup"&gt;Status =
IF (  [calibration_due]  &amp;lt;= TODAY(), "Urgent Action Required",
IF (  [calibration_due]  &amp;gt;= EDATE(TODAY(), 3), "OK",
IF (  [calibration_due] &amp;gt; TODAY() &amp;amp;&amp;amp; [calibration_due] &amp;lt; EDATE(TODAY(), 3), "Set up new Calibration",
IF ( [calibration_due] = BLANK(), "Set Up Calibration Date")&lt;/LI-CODE&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;Joe&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 13:13:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3968837#M153911</guid>
      <dc:creator>Joe_Barry</dc:creator>
      <dc:date>2024-06-03T13:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using DAX for converting dates to status categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3968884#M153915</link>
      <description>&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;Thanks for your help. Your code gave me an error as I don't have an 'incidents' column. I replaced those parts, and ended up with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IsCalibrationDue = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; ( &amp;nbsp;[calibration_due] &amp;nbsp;&amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN&gt;"Urgent Action Required"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; ( &amp;nbsp;[calibration_due] &amp;nbsp;&amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;EDATE&lt;/SPAN&gt;&lt;SPAN&gt;([calibration_due]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[Date], &lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"OK"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; ( &amp;nbsp;[calibration_due] &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;() &amp;amp;&amp;amp; [calibration_due] &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;EDATE&lt;/SPAN&gt;&lt;SPAN&gt;([calibration_due]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[Date], &lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"Set up new Calibration"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; ( [calibration_due] = &lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN&gt;"Set Up Calibration Date"&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;This returns only 2 outputs:&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;- 'Set up new calibrations': this output appears for every cell that contains a date, regardless of when that date is.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;- 'Urgent action required': this output appears for all empty cells.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any ideas on how to proceed?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 03 Jun 2024 13:16:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3968884#M153915</guid>
      <dc:creator>oliverome</dc:creator>
      <dc:date>2024-06-03T13:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using DAX for converting dates to status categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3968895#M153917</link>
      <description>&lt;P&gt;Sorry, I edited afterwards as I seen an error, please give the below a shot&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Status =
IF (  [calibration_due]  &amp;lt;= TODAY(), "Urgent Action Required",
IF (  [calibration_due]  &amp;gt;= EDATE(TODAY(), 3), "OK",
IF (  [calibration_due] &amp;gt; TODAY() &amp;amp;&amp;amp; [calibration_due] &amp;lt; EDATE(TODAY(), 3), "Set up new Calibration",
IF ( [calibration_due] = BLANK(), "Set Up Calibration Date")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 13:18:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3968895#M153917</guid>
      <dc:creator>Joe_Barry</dc:creator>
      <dc:date>2024-06-03T13:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using DAX for converting dates to status categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3970421#M153988</link>
      <description>&lt;P&gt;Thank you again for your help! The first if-statement needed a slight modification, as it interpreted a blank cell as 0, therefore giving all blank cells the output 'urgent action required'. I have added an 'is not blank' statement to that line and now it works perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IsCalibrationDue = 

IF (  [calibration_due]  &amp;lt;= TODAY() &amp;amp;&amp;amp; NOT(ISBLANK([calibration_due])), "Urgent Action Required",
IF (  [calibration_due]  &amp;gt;= EDATE(TODAY(), 3), "OK",
IF (  [calibration_due] &amp;gt; TODAY() &amp;amp;&amp;amp; [calibration_due] &amp;lt; EDATE(TODAY(), 3), "Set up new Calibration",
IF ( [calibration_due] = BLANK(), "Set Up Calibration Date"))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 06:39:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-DAX-for-converting-dates-to-status-categories/m-p/3970421#M153988</guid>
      <dc:creator>oliverome</dc:creator>
      <dc:date>2024-06-04T06:39:51Z</dc:date>
    </item>
  </channel>
</rss>

