<?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: If statement with date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-with-date/m-p/3578571#M138001</link>
    <description>&lt;P&gt;Please try the following formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Start Date = 
var startOfThisMonth = EOMONTH(TODAY(), -1) + 1
return IF('Table'[created_at] &amp;lt; startOfThisMonth, startOfThisMonth, 'Table'[created_at])&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 12 Dec 2023 00:00:12 GMT</pubDate>
    <dc:creator>vicky_</dc:creator>
    <dc:date>2023-12-12T00:00:12Z</dc:date>
    <item>
      <title>If statement with date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-with-date/m-p/3578385#M137994</link>
      <description>&lt;P&gt;I have linked to our new maintenance system in PowerBi. I am trying to automate the machine downtime metric. In the calculation date field, I have an IF statement that says&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calculation Date =&lt;/SPAN&gt; &lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;isblank&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Completed on]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;[Current Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;[Completed on]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;). The point of this one is that to measure the downtime to date, I have to have an end. So if the work order in not completed, it returns the current date. This one works well. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am new to PowerBi so I am stumbling through this.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;I have a field [created.on]. I need a statement that says if [created.on] is before the current month, return the first date of the current month, if not return [created.on]. The reason for this is that downtime is measured by a monthly metric. So as the work order was started on 11/26, the downtime from 11/26-11/30 would be counted on the November downtime report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if anything is not clear. Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 21:58:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-with-date/m-p/3578385#M137994</guid>
      <dc:creator>ashely_nave</dc:creator>
      <dc:date>2023-12-11T21:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-with-date/m-p/3578571#M138001</link>
      <description>&lt;P&gt;Please try the following formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Start Date = 
var startOfThisMonth = EOMONTH(TODAY(), -1) + 1
return IF('Table'[created_at] &amp;lt; startOfThisMonth, startOfThisMonth, 'Table'[created_at])&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Dec 2023 00:00:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-with-date/m-p/3578571#M138001</guid>
      <dc:creator>vicky_</dc:creator>
      <dc:date>2023-12-12T00:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-with-date/m-p/3579814#M138061</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 13:33:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-with-date/m-p/3579814#M138061</guid>
      <dc:creator>ashely_nave</dc:creator>
      <dc:date>2023-12-12T13:33:20Z</dc:date>
    </item>
  </channel>
</rss>

