<?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: Date slicer buttons last 7 days, last 30 days, last 12 months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-slicer-buttons-last-7-days-last-30-days-last-12-months/m-p/3128359#M111208</link>
    <description>&lt;P&gt;One option would be to create a calculation group with items for each period you want to cover, e.g.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Last 7 days =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], TODAY () - 7, TODAY () )
)

Last 30 days =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], TODAY () - 30, TODAY () )
)

Last 12 months =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], EOMONTH ( TODAY (), -13 ) + 1, TODAY () )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2023 14:48:45 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2023-03-13T14:48:45Z</dc:date>
    <item>
      <title>Date slicer buttons last 7 days, last 30 days, last 12 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-slicer-buttons-last-7-days-last-30-days-last-12-months/m-p/3128131#M111196</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table for customer ids and transaction info. I have another table "Calender" which helped me to find a measure average transactions per day per customer. Now I need to make 3 buttons without using relative date slicer, which will give me last 7 days, last 30 days, last 12 months so that the values in dashboard change accordingly. Kindly guide me, Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 13:38:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-slicer-buttons-last-7-days-last-30-days-last-12-months/m-p/3128131#M111196</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-13T13:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Date slicer buttons last 7 days, last 30 days, last 12 months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-slicer-buttons-last-7-days-last-30-days-last-12-months/m-p/3128359#M111208</link>
      <description>&lt;P&gt;One option would be to create a calculation group with items for each period you want to cover, e.g.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Last 7 days =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], TODAY () - 7, TODAY () )
)

Last 30 days =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], TODAY () - 30, TODAY () )
)

Last 12 months =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], EOMONTH ( TODAY (), -13 ) + 1, TODAY () )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 14:48:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-slicer-buttons-last-7-days-last-30-days-last-12-months/m-p/3128359#M111208</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-03-13T14:48:45Z</dc:date>
    </item>
  </channel>
</rss>

