<?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: How to resolve the error A function 'DATEADD' has been used in a True/False expression that is used in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-resolve-the-error-A-function-DATEADD-has-been-used-in-a/m-p/1169464#M17997</link>
    <description>&lt;P&gt;Encapsulate it in a FILTER() .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;measure :=
CALCULATE (
SUM ( 'Table'[Amount] ),
'Table'[Status] IN { "A" },
FILTER(CALENDER,IF (
LEFT ( 'CALENDER'[YEARMONTH], 4 ) IN { "2019", "2020" },
DATEADD ( DATEADD ( 'CALENDER'[Date], -1, YEAR ), 2, DAY ),
DATEADD ( DATEADD ( 'CALENDER'[Date], -1, YEAR ), 1, DAY )
))
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Btw, it's Calendar, not Calender. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jun 2020 16:58:45 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2020-06-18T16:58:45Z</dc:date>
    <item>
      <title>How to resolve the error A function 'DATEADD' has been used in a True/False expression that is used</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-resolve-the-error-A-function-DATEADD-has-been-used-in-a/m-p/1169018#M17987</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I want to sum Amount with some conditions like below:&lt;BR /&gt;If a year month value is 2019 or 2020, it sums Amount of 1 year ago with 2 days plus.&lt;BR /&gt;(for example, 2020/1/1 -&amp;gt; value of 2019/1/3)&lt;BR /&gt;If a year month value is not 2019 or 2020, it sums Amount of of 1 year ago with 1 day minus.&lt;BR /&gt;However, got the error with the below measure.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;measure :=&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( 'Table'[Amount] ),&lt;BR /&gt;'Table'[Status] IN { "A" },&lt;BR /&gt;IF (&lt;BR /&gt;LEFT ( 'CALENDAR'[YEARMONTH], 4 ) IN { "2019", "2020" },&lt;BR /&gt;DATEADD ( DATEADD ( 'CALENDAR'[Date], -1, YEAR ), 2, DAY ),&lt;BR /&gt;DATEADD ( DATEADD ( 'CALENDAR'[Date], -1, YEAR ), 1, DAY )&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Error:&lt;BR /&gt;A function 'DATEADD' has been used in a True/False expression that is used as a table filter expression.&lt;BR /&gt;This is not allowed.&lt;/P&gt;&lt;P&gt;How can I resolve that?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 23:54:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-resolve-the-error-A-function-DATEADD-has-been-used-in-a/m-p/1169018#M17987</guid>
      <dc:creator>PbiCeo</dc:creator>
      <dc:date>2020-06-18T23:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve the error A function 'DATEADD' has been used in a True/False expression that is used</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-resolve-the-error-A-function-DATEADD-has-been-used-in-a/m-p/1169464#M17997</link>
      <description>&lt;P&gt;Encapsulate it in a FILTER() .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;measure :=
CALCULATE (
SUM ( 'Table'[Amount] ),
'Table'[Status] IN { "A" },
FILTER(CALENDER,IF (
LEFT ( 'CALENDER'[YEARMONTH], 4 ) IN { "2019", "2020" },
DATEADD ( DATEADD ( 'CALENDER'[Date], -1, YEAR ), 2, DAY ),
DATEADD ( DATEADD ( 'CALENDER'[Date], -1, YEAR ), 1, DAY )
))
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Btw, it's Calendar, not Calender. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 16:58:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-resolve-the-error-A-function-DATEADD-has-been-used-in-a/m-p/1169464#M17997</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-18T16:58:45Z</dc:date>
    </item>
  </channel>
</rss>

