<?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: Calculated Column for one year from today in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-one-year-from-today/m-p/2977659#M99732</link>
    <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="487410" data-lia-user-login="domtrump" class="lia-mention lia-mention-user"&gt;domtrump&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Try to add a column with this:&lt;/DIV&gt;&lt;DIV&gt;Status1=&lt;/DIV&gt;&lt;DIV&gt;IF(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;[Date]&amp;gt;=EDATE(TODAY(), -12),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;"Yes",&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;"No"&lt;/DIV&gt;&lt;DIV&gt;)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;or&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Status2=&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Date]&amp;gt;=DATE( YEAR(TODAY())-1, MONTH(TODAY()), DAY(TODAY())),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Yes",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"No"&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;DATEADD is Time Intelligence function, which always replies on dedicated Date Tabke.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 20 Dec 2022 00:15:35 GMT</pubDate>
    <dc:creator>FreemanZ</dc:creator>
    <dc:date>2022-12-20T00:15:35Z</dc:date>
    <item>
      <title>Calculated Column for one year from today</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-one-year-from-today/m-p/2977576#M99724</link>
      <description>&lt;P&gt;I thought this would be really simple, but it is proving to be a serious nusance. All I want to do is determine if a date in one column of my table is within the last 12 months. I need this in a calculated column. It&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=dateadd(InitialStudyLoad[TODAYDate],-1,year)&lt;/LI-CODE&gt;&lt;P&gt;will eventually be used in an IF statement to assign a category, but for now, I'm breaking it into steps to try to find out where the issue is. The column of interest is TransDate. If the TransDate is between TODAY-1 Year and TODAY I will call that customer ACTIVE. Otherwise something else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So first, I just tried to create a column that calculated the date for one year ago from today using&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=dateadd(today(),-1,year)&lt;/LI-CODE&gt;&lt;P&gt;That gave an error stating the first argument had to be a column. So I created a [helper] column that just generates today's date [=TODAY()] and named it TODAYDate. I used this new column in my calculation as such&lt;!-- EndFragment  --&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=dateadd(InitialStudyLoad[TODAYDate],-1,year)&lt;/LI-CODE&gt;&lt;P&gt;No error this time but the column generates nothing but BLANKS! I cannot understand why this is so difficult. I just need a column that generates a "flag" such that if the transaction date is within the last year from today, mark them as "ACTIVE". This column will be used as a slicer. I'm sure it is something small and silly in my syntax but it is just not clicking for me today. What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE:&lt;/P&gt;&lt;P&gt;In plain old Excel, if I use&amp;nbsp;&lt;STRONG&gt;=IF(TODAY()-A1&amp;lt;=364,"ACTIVE","NOT ACTIVE")&lt;/STRONG&gt; where A1 is the TransDate, works like a charm. The same formula in a calculated column also works replacing A1 with "InitialStudyLoad[TransDate]". How can I do this same simple calculation in DAX without specifying the exact number of days (i.e. "&lt;STRONG&gt;minus one year"&lt;/STRONG&gt;)? Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 22:07:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-one-year-from-today/m-p/2977576#M99724</guid>
      <dc:creator>domtrump</dc:creator>
      <dc:date>2022-12-19T22:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column for one year from today</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-one-year-from-today/m-p/2977653#M99730</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IF(DATEDIFF(TODAY(),[Specific Date], DAY) &amp;lt;= 364,"ACTIVE","NOT ACTIVE")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 20 Dec 2022 00:02:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-one-year-from-today/m-p/2977653#M99730</guid>
      <dc:creator>vicky_</dc:creator>
      <dc:date>2022-12-20T00:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column for one year from today</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-one-year-from-today/m-p/2977659#M99732</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="487410" data-lia-user-login="domtrump" class="lia-mention lia-mention-user"&gt;domtrump&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Try to add a column with this:&lt;/DIV&gt;&lt;DIV&gt;Status1=&lt;/DIV&gt;&lt;DIV&gt;IF(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;[Date]&amp;gt;=EDATE(TODAY(), -12),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;"Yes",&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;"No"&lt;/DIV&gt;&lt;DIV&gt;)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;or&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Status2=&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Date]&amp;gt;=DATE( YEAR(TODAY())-1, MONTH(TODAY()), DAY(TODAY())),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Yes",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"No"&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;DATEADD is Time Intelligence function, which always replies on dedicated Date Tabke.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Dec 2022 00:15:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column-for-one-year-from-today/m-p/2977659#M99732</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-12-20T00:15:35Z</dc:date>
    </item>
  </channel>
</rss>

