<?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: Last 7/14/30 with Same Days Dax Measure for Visual Filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4091356#M162374</link>
    <description>&lt;P&gt;Thanks again for your help, much appreciated!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_heart_eyes:"&gt;😍&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Aug 2024 09:45:08 GMT</pubDate>
    <dc:creator>cn4422</dc:creator>
    <dc:date>2024-08-09T09:45:08Z</dc:date>
    <item>
      <title>Last 7/14/30 with Same Days Dax Measure for Visual Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4089417#M162310</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a DAX measure for simple dates, like "last 7/14/30" days and a "same period as last 7/14/30 days before" that I can then use as a filter for visuals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So basically I have one visual that should have a date range "last 7 days" (for this I wouldn't need a DAX measure) and I have the same visual a second time that has "last 14-7 days", to get a comparison.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already created a DateTable 'Datum[Date]' to which the date periode should reference (since I have multiple relationships with the DateTable--&amp;gt;Other tables).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure this is pretty easy, but I somehow don't get it.&lt;BR /&gt;I can do calculations with time periods included and stuff, but somehow I'm not able to accomplish a simple time period...&lt;BR /&gt;&lt;BR /&gt;Thx for your help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 13:59:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4089417#M162310</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2024-08-08T13:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Last 7/14/30 with Same Days Dax Measure for Visual Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4089429#M162311</link>
      <description>&lt;P&gt;I think this may be what you're after. All you have to do is update the date ranges.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Calendar Ageing = 
VAR _today_date =       TODAY()
VAR _min_date =         DATE( YEAR( _today_date ) - 6, 01, 01 )

VAR _result = 
UNION (
      ADDCOLUMNS (CALENDAR ( _today_date - 7, _today_date),         "Ageing Days", "0 to 7",    "Ageing Days Order", 1)
    , ADDCOLUMNS (CALENDAR ( _today_date - 14, _today_date - 8 ),   "Ageing Days", "8 to 14",   "Ageing Days Order", 2)
    , ADDCOLUMNS (CALENDAR ( _today_date - 30, _today_date - 15 ),  "Ageing Days", "15 to 30",  "Ageing Days Order", 3)
    , ADDCOLUMNS (CALENDAR ( _min_date, _today_date - 31),          "Ageing Days", "30+",       "Ageing Days Order", 4)
)

RETURN
_result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can set the order of the label to the sort order column&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;After that, you can update the relationship to the calendar table&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then any metric you have associated to the calendar table can use the ageing table&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 03:23:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4089429#M162311</guid>
      <dc:creator>aduguid</dc:creator>
      <dc:date>2024-08-09T03:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Last 7/14/30 with Same Days Dax Measure for Visual Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4090826#M162356</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cool, thanks for your answer, I will try this out!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":ok_hand:"&gt;👌&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another quick question: Is there a simple way to build a measure that shows for example the last 7 days?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Last 7 days =&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Datum[Date], Today, -7, day&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(please excuse my poor DAX understanding ^^)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 06:15:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4090826#M162356</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2024-08-09T06:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Last 7/14/30 with Same Days Dax Measure for Visual Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4091108#M162363</link>
      <description>&lt;P&gt;Try this measure&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Last 7 Days Measure =
CALCULATE(
    SUM('YourTable'[YourValueColumn]), 
    DATESINPERIOD(
        'Datum'[Date], 
        MAX('Datum'[Date]), 
        -7, 
        DAY
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Aug 2024 08:04:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4091108#M162363</guid>
      <dc:creator>aduguid</dc:creator>
      <dc:date>2024-08-09T08:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Last 7/14/30 with Same Days Dax Measure for Visual Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4091117#M162364</link>
      <description>&lt;P&gt;Ok - and is this possible without the "SUM-Part"?&amp;nbsp;&lt;BR /&gt;So that the output of the measure is only the date period (last 7 days?)&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 08:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4091117#M162364</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2024-08-09T08:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Last 7/14/30 with Same Days Dax Measure for Visual Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4091142#M162366</link>
      <description>&lt;P&gt;If you want to return the last 7 days as dates.&amp;nbsp; Try this DAX query.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Last 7 Days = CALENDAR(TODAY() - 7, TODAY())&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Aug 2024 08:16:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4091142#M162366</guid>
      <dc:creator>aduguid</dc:creator>
      <dc:date>2024-08-09T08:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Last 7/14/30 with Same Days Dax Measure for Visual Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4091356#M162374</link>
      <description>&lt;P&gt;Thanks again for your help, much appreciated!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_heart_eyes:"&gt;😍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 09:45:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-7-14-30-with-Same-Days-Dax-Measure-for-Visual-Filter/m-p/4091356#M162374</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2024-08-09T09:45:08Z</dc:date>
    </item>
  </channel>
</rss>

