<?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 Showing Products between two dates depending on Cal Filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2449905#M65897</link>
    <description>&lt;P&gt;Hello!&lt;BR /&gt;&lt;BR /&gt;I'm via a CalculatedTable trying to filter out products that are between 4-5years old by their "Released for Sales Date".&lt;BR /&gt;&lt;BR /&gt;If I select a year (for e.g. 2021) I want to see products that have a RFSD between 2016/01/01 - 2016/12/31. If I selected a month, (for e.g. December 2021) I only want to show products with a RFSD between 2016/12/01 - 2016/12/31.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My measure seems to be working somewhat but is only filtering on the latest date in the report and is not being filtered by my calender selection.&lt;BR /&gt;&lt;BR /&gt;I've tried to troubleshoot with no luck.&amp;nbsp; My VAR calenderfilters and FilteredMonth are working. I have an&amp;nbsp; inactive connection between Cal[Date] and ReleasedforSalesDate (cannot be active because I have an active between Cal and my main Fact Table).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Another picture for clarification. The ReleasedforSalesDate table in the bottom right is ignoring any date filtered and is only showing products between 4-5years old from my latest reportdate (2022/04/05).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&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;&lt;P&gt;My current Measure!&lt;/P&gt;&lt;PRE&gt;RFSD Outgoing( 4 - 5Y ) =
VAR startdate = dateadd( LASTDATE( Cal[Date] ), -72, MONTH ) 
VAR enddate = dateadd( LASTDATE( Cal[Date] ), -60, MONTH ) 
VAR Altenddate = dateadd( LASTDATE( Cal[Date] ), -61, MONTH ) 

RETURN
IF(
    [FilteredMonth] = TRUE(),
    IF(
        AND(
          'Product'[ReleasedForSalesDate] &amp;gt;= Altenddate,
          'Product'[ReleasedForSalesDate] &amp;lt; enddate
        ),
        1,
        0
    ),
    IF(
        AND(
          'Product'[ReleasedForSalesDate] &amp;gt;= startdate,
          'Product'[ReleasedForSalesDate] &amp;lt; enddate
        ),
        1,
        0
    )
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Any help or pointing me in the right direction would be apreciated!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Apr 2022 14:43:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-04-11T14:43:06Z</dc:date>
    <item>
      <title>Showing Products between two dates depending on Cal Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2449905#M65897</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;&lt;BR /&gt;I'm via a CalculatedTable trying to filter out products that are between 4-5years old by their "Released for Sales Date".&lt;BR /&gt;&lt;BR /&gt;If I select a year (for e.g. 2021) I want to see products that have a RFSD between 2016/01/01 - 2016/12/31. If I selected a month, (for e.g. December 2021) I only want to show products with a RFSD between 2016/12/01 - 2016/12/31.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My measure seems to be working somewhat but is only filtering on the latest date in the report and is not being filtered by my calender selection.&lt;BR /&gt;&lt;BR /&gt;I've tried to troubleshoot with no luck.&amp;nbsp; My VAR calenderfilters and FilteredMonth are working. I have an&amp;nbsp; inactive connection between Cal[Date] and ReleasedforSalesDate (cannot be active because I have an active between Cal and my main Fact Table).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Another picture for clarification. The ReleasedforSalesDate table in the bottom right is ignoring any date filtered and is only showing products between 4-5years old from my latest reportdate (2022/04/05).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&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;&lt;P&gt;My current Measure!&lt;/P&gt;&lt;PRE&gt;RFSD Outgoing( 4 - 5Y ) =
VAR startdate = dateadd( LASTDATE( Cal[Date] ), -72, MONTH ) 
VAR enddate = dateadd( LASTDATE( Cal[Date] ), -60, MONTH ) 
VAR Altenddate = dateadd( LASTDATE( Cal[Date] ), -61, MONTH ) 

RETURN
IF(
    [FilteredMonth] = TRUE(),
    IF(
        AND(
          'Product'[ReleasedForSalesDate] &amp;gt;= Altenddate,
          'Product'[ReleasedForSalesDate] &amp;lt; enddate
        ),
        1,
        0
    ),
    IF(
        AND(
          'Product'[ReleasedForSalesDate] &amp;gt;= startdate,
          'Product'[ReleasedForSalesDate] &amp;lt; enddate
        ),
        1,
        0
    )
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Any help or pointing me in the right direction would be apreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 14:43:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2449905#M65897</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-11T14:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Products between two dates depending on Cal Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2450024#M65901</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I'm not following 100%. You can have date discontinued in product table, you should be able create a column for "time discontinued".&amp;nbsp; You can subtract the date INT(TODAY() - Date Discontinued. If it's more than 400 or 500 days you can add a column with this type indicator.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example what result do you want to see for result when wanting&lt;SPAN&gt;&amp;nbsp;to show products with a RFSD between 2016/12/01 - 2016/12/31? Can you show where that answer comes from? I'mguessing it's something like &lt;STRONG&gt;CALCULATE(COUNTROWS(Products, [Disc 4-5 yrs flag] &amp;gt; 0),&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;USERELATIONSHIP(Dates[Date], Products[ReleasedforSalesDate]))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;or&lt;BR /&gt;var currdate = MAX(Dates[Date]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;CALCULATE(COUNTROWS(Products, [Released for Sales Date] &amp;lt; currdate),&amp;nbsp;&lt;BR /&gt;USERELATIONSHIP(Dates[Date], Products[ReleasedforSalesDate]))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think your main question could be how to access the product table you can have USEREATIONSHIP or create a seond date table. E.G.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 15:45:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2450024#M65901</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-04-11T15:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Products between two dates depending on Cal Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2450190#M65913</link>
      <description>&lt;P&gt;Thank you for giving this a shot. At this stage i'm only trying to get the filter to work.&amp;nbsp; I'm using the calculated table to filter the visual via the built in function in PBI. From my limited understanding the filtering context is not working even though I have a connection to my calender and I can't understand why or how to get around it.&lt;BR /&gt;&lt;BR /&gt;In the end I want a tablevisual with a list of the products between 4-5 years old in the sliced calender context.&lt;BR /&gt;Are you saying I need to to use a measure to filter out the products by USERELATIONSHIP and shouldn't use the PBI built in "Filter on this visual"?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My expected result is when I select 2021 in the Yearmonth slicer, I want the dates in my right "releasedforsalestable" (which is filtered on RFSD = 1) to only show the RFSD greater than startdate (2015-12-21) and less than enddate (2016-12-31). As of now it is showing the RFSD where startdate is 2016-04-05 and enddate is 2017-04-05 which is between 4-5years from my latest caldate (2022-04-05) instead of my filtered caldate (2021-12-31).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is there anything I can provide to make this easier to understand? The report is 1,3G big so I can't share everything but I can create some sampledata if there's any specifics needed to clarify.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 16:48:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2450190#M65913</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-11T16:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Products between two dates depending on Cal Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2450517#M65930</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I'm not sure if this is what you are looking for. I got my hands on some product data and have this to look at:&lt;/P&gt;&lt;P&gt;&lt;A title="Product Age Groups" href="https://drive.google.com/file/d/1pQcm4OQ47UX1yJ8k_CmQFApxX6IjvZIK/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1pQcm4OQ47UX1yJ8k_CmQFApxX6IjvZIK/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Today has been a little crazy and not much time to spend. I hope this helps somewhat..&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 20:29:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2450517#M65930</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-04-11T20:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Showing Products between two dates depending on Cal Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2451941#M66021</link>
      <description>&lt;P&gt;Thank you! The solution was to filter via a measure instead of a calculated column.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 09:29:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Showing-Products-between-two-dates-depending-on-Cal-Filter/m-p/2451941#M66021</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-12T09:29:42Z</dc:date>
    </item>
  </channel>
</rss>

