<?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: Compare dates not working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-dates-not-working/m-p/1271136#M21412</link>
    <description>&lt;P&gt;There are things which are wrong about this formula. And certainly there is no bug in DAX itself. How many time do I read/hear people saying "It must be a bug" only to show them that it's not a bug but their misunderstanding of DAX? Same story here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, if your [Plan R@R (internal) Date] is connected to Dates, then no wonder you don't get anything as a result. If you think carefully about what the below does:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;MAX('NPLM Import'[Plan R@R (internal) Date])
&amp;gt;= 
DATE(
    MAX(Dates[Year]),
    MAX(Dates[MonthOfYear]),
    1+MAX(Dates[DayOfMonth])
)&lt;/LI-CODE&gt;&lt;P&gt;you'll find out immediately that the first MAX can't be greater than the RHS of the inequality.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondly, what's the purpose of ISERROR? Do you really expect to get an error from&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;SUM('NPLM Import'[Yearly average turnover (EUR)])?&lt;/LI-CODE&gt;&lt;P&gt;If you do, then it means there's something seriously wrong with your data model&lt;/P&gt;</description>
    <pubDate>Tue, 04 Aug 2020 10:03:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-04T10:03:23Z</dc:date>
    <item>
      <title>Compare dates not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-dates-not-working/m-p/1268939#M21337</link>
      <description>&lt;P class="lia-align-left"&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my aim is&amp;nbsp;to compare two dates within an if clause.&lt;/P&gt;&lt;P&gt;Naturally, the formula should show all values, if their date is larger than my selected date (03.08.2020).&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I don't know why the following dax is not working&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;Ø Annual Turnover (EUR) Done = 
IF(
   MAX('NPLM Import'[Plan R@R (internal) Date]) &amp;gt;= (DATE(MAX(Dates[Year]), MAX(Dates[MonthOfYear]), 1+MAX(Dates[DayOfMonth]))), 
      IFERROR(SUM('NPLM Import'[Yearly average turnover (EUR)]), "")
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replacing the part after &amp;gt;= with MAX('Dates'[Date]) oder SELECTEDVALUE('Dates'[Date]) is either giving me no values or shows all values.&lt;/P&gt;&lt;P&gt;It works fine when I replace it with a date(2020,08,03) or today(), but I need to have it dynamically with a date slicer.&lt;/P&gt;&lt;LI-CODE lang="css"&gt;Ø Annual Turnover (EUR) Done = 
IF(
   MAX('NPLM Import'[Plan R@R (internal) Date]) &amp;gt;= (DATE(2020,08,03)), 
      IFERROR(SUM('NPLM Import'[Yearly average turnover (EUR)]), "")
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to avoid this bug?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 14:54:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-dates-not-working/m-p/1268939#M21337</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-03T14:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-dates-not-working/m-p/1268963#M21341</link>
      <description>&lt;P&gt;Not really enough information to go on, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 15:04:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-dates-not-working/m-p/1268963#M21341</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-08-03T15:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-dates-not-working/m-p/1271136#M21412</link>
      <description>&lt;P&gt;There are things which are wrong about this formula. And certainly there is no bug in DAX itself. How many time do I read/hear people saying "It must be a bug" only to show them that it's not a bug but their misunderstanding of DAX? Same story here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, if your [Plan R@R (internal) Date] is connected to Dates, then no wonder you don't get anything as a result. If you think carefully about what the below does:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;MAX('NPLM Import'[Plan R@R (internal) Date])
&amp;gt;= 
DATE(
    MAX(Dates[Year]),
    MAX(Dates[MonthOfYear]),
    1+MAX(Dates[DayOfMonth])
)&lt;/LI-CODE&gt;&lt;P&gt;you'll find out immediately that the first MAX can't be greater than the RHS of the inequality.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Secondly, what's the purpose of ISERROR? Do you really expect to get an error from&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;SUM('NPLM Import'[Yearly average turnover (EUR)])?&lt;/LI-CODE&gt;&lt;P&gt;If you do, then it means there's something seriously wrong with your data model&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 10:03:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-dates-not-working/m-p/1271136#M21412</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-04T10:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-dates-not-working/m-p/1271699#M21437</link>
      <description>&lt;P&gt;Solved the problem myself.&lt;/P&gt;&lt;P&gt;The problem was that several dates had to be evaluated while only one was expected. I changed the "Dates" part with a new column which only shows the first date of each week for each date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;Ø Annual Turnover (EUR) Done = 
IF(
   MAX('NPLM Import'[Plan R@R (internal) Date]) &amp;gt;= SELECTEDVALUE('Dates(2)'[StartofWeek]), 
      IFERROR(SUM('NPLM Import'[Yearly average turnover (EUR)]), "")
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Btw: There is nothing wrong with my dataset and&amp;nbsp;connections are still maintained as before. My original post &lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Compare-dates/m-p/1268717" target="_blank" rel="noopener"&gt;(https://community.powerbi.com/t5/DAX-Commands-and-Tips/Compare-dates/m-p/1268717&lt;/A&gt;) which was marked as spam, disappeared and suddenly&amp;nbsp;&lt;SPAN&gt;returned&lt;/SPAN&gt;&lt;SPAN&gt;, did help me solve the issue instead of instructing me.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 13:21:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Compare-dates-not-working/m-p/1271699#M21437</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-04T13:21:22Z</dc:date>
    </item>
  </channel>
</rss>

