<?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 Using date name and datesinperiod in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-date-name-and-datesinperiod/m-p/2925274#M96074</link>
    <description>&lt;P&gt;I'm missing something simple, please help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a fact table and a date dimension linked on an integer surrogate key. The date dimension has the full date and also a Date Name column, so we can have slicers like "Today" and "Yesterday", and I can easily count how many events happened today&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Calls Received = COUNTROWS('Fact Call Records')&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;But when I'm trying to count how many happened in the last 30 days, I'm struggling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Calls Received in Last 30 Days = 
    var SelectedDate = MAX('Dim Date'[FullDate])
    RETURN
    CALCULATE(
        'Fact Call Records'[Calls Received]
        ,DATESINPERIOD('Dim Date'[FullDate],SelectedDate,-30,DAY)
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;works when FullDate is used as the slicer, but when I slice using DateName it returns the same as the single day count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;</description>
    <pubDate>Wed, 23 Nov 2022 19:26:30 GMT</pubDate>
    <dc:creator>benohara</dc:creator>
    <dc:date>2022-11-23T19:26:30Z</dc:date>
    <item>
      <title>Using date name and datesinperiod</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-date-name-and-datesinperiod/m-p/2925274#M96074</link>
      <description>&lt;P&gt;I'm missing something simple, please help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a fact table and a date dimension linked on an integer surrogate key. The date dimension has the full date and also a Date Name column, so we can have slicers like "Today" and "Yesterday", and I can easily count how many events happened today&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Calls Received = COUNTROWS('Fact Call Records')&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;But when I'm trying to count how many happened in the last 30 days, I'm struggling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Calls Received in Last 30 Days = 
    var SelectedDate = MAX('Dim Date'[FullDate])
    RETURN
    CALCULATE(
        'Fact Call Records'[Calls Received]
        ,DATESINPERIOD('Dim Date'[FullDate],SelectedDate,-30,DAY)
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;works when FullDate is used as the slicer, but when I slice using DateName it returns the same as the single day count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 19:26:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-date-name-and-datesinperiod/m-p/2925274#M96074</guid>
      <dc:creator>benohara</dc:creator>
      <dc:date>2022-11-23T19:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using date name and datesinperiod</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-date-name-and-datesinperiod/m-p/2925291#M96075</link>
      <description>&lt;P&gt;Typical, 9 minutes after posting I work out the solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My date dimension wasn't marked as a date dimension. Right clicking on it and setting the full date field made it work as expected!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 19:39:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-date-name-and-datesinperiod/m-p/2925291#M96075</guid>
      <dc:creator>benohara</dc:creator>
      <dc:date>2022-11-23T19:39:16Z</dc:date>
    </item>
  </channel>
</rss>

