<?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 if date is within last 7 days using Calendar Dimension in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/1686660#M34660</link>
    <description>&lt;P&gt;Thank you, this works! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2021 12:40:38 GMT</pubDate>
    <dc:creator>C-Jac</dc:creator>
    <dc:date>2021-02-24T12:40:38Z</dc:date>
    <item>
      <title>Calculated column if date is within last 7 days using Calendar Dimension</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/1681356#M34507</link>
      <description>&lt;P&gt;I have two tables. One is a Calendar Dimension the other has values in it. They are linked by an ID, and I need to create a 'flag' to determine whether the value row is in the past 7 days, but I can't seem to get the relationship to work. I tried using USERELATIONSHIP and RELATED and RELATEDTABLE, but maybe I'm unable to get it to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calendar Dimension:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Id&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Date&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;01/01/2021&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;02/01/2021&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;..&lt;/TD&gt;&lt;TD&gt;..&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;20/01/2021&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;21/01/2021&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Values table:&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Value&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;DateID&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;InPast7Days&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;500&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;0&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-400&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;0&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;900&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i want is to use the relationship, to add the column with the 0's if the date is not within the past 7 days, and 1 if it is within the past 7 days. Hope this makes sense, and that you can help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 16:02:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/1681356#M34507</guid>
      <dc:creator>C-Jac</dc:creator>
      <dc:date>2021-02-22T16:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column if date is within last 7 days using Calendar Dimension</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/1681455#M34510</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="276471" data-lia-user-login="C-Jac" class="lia-mention lia-mention-user"&gt;C-Jac&lt;/a&gt; , Create new column in values table &lt;/P&gt;
&lt;P&gt;if(related([Date]) &amp;gt;= today()-7 &amp;amp;&amp;amp; related([Date]) &amp;lt;= today(),1,0)&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 16:36:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/1681455#M34510</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-02-22T16:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column if date is within last 7 days using Calendar Dimension</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/1681922#M34530</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="276471" data-lia-user-login="C-Jac" class="lia-mention lia-mention-user"&gt;C-Jac&lt;/a&gt;&amp;nbsp;, make sure a relationship is correctly established between two tables by this means:&amp;nbsp;&lt;STRONG&gt;Calendar[ID] (1:*)&amp;nbsp;Values[DateID]&lt;/STRONG&gt;; then you might want to try adding a calculated column in Values table,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;InPast7Days = 
VAR __dt = RELATED ( Calendar[Date] )
RETURN
    ( TODAY () - 7 &amp;lt;= __dt &amp;amp;&amp;amp; __dt &amp;lt;= TODAY() ) + 0&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;</description>
      <pubDate>Mon, 22 Feb 2021 21:29:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/1681922#M34530</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2021-02-22T21:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column if date is within last 7 days using Calendar Dimension</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/1686660#M34660</link>
      <description>&lt;P&gt;Thank you, this works! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 12:40:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/1686660#M34660</guid>
      <dc:creator>C-Jac</dc:creator>
      <dc:date>2021-02-24T12:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column if date is within last 7 days using Calendar Dimension</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/3656731#M141671</link>
      <description>&lt;P&gt;thank you .ıt works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 11:33:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-if-date-is-within-last-7-days-using-Calendar/m-p/3656731#M141671</guid>
      <dc:creator>Muhammetmuslu</dc:creator>
      <dc:date>2024-01-24T11:33:31Z</dc:date>
    </item>
  </channel>
</rss>

