<?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: Need help filtering data using DAX &amp;amp; TimeSlicer, in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2574780#M73666</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you write: "&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Let say for exemple that we are in July 2021, i want to filter the table to only keep the following lines:&lt;/P&gt;&lt;P&gt;User1, 01/01/2021, Val2&lt;/P&gt;&lt;P&gt;User2, 01/02/2020, Val1&lt;/P&gt;&lt;P&gt;User3, 01/06/2021, Val3", could you you explain your filtering logic (the criteria of filtering)?&amp;nbsp; If the criteria of filtering are clear, we can help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jun 2022 09:49:40 GMT</pubDate>
    <dc:creator>ManguilibeKAO</dc:creator>
    <dc:date>2022-06-13T09:49:40Z</dc:date>
    <item>
      <title>Need help filtering data using DAX &amp; TimeSlicer,</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2571145#M73435</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following User table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date, UserKey, Value&lt;/P&gt;&lt;P&gt;01/01/2019,User1,Val1&lt;BR /&gt;01/01/2021,User1,Val2&lt;BR /&gt;01/01/2022,User1,Val3&lt;/P&gt;&lt;P&gt;01/02/2020,User2,Val1&lt;BR /&gt;01/08/2021,User2,Val2&lt;BR /&gt;01/10/2022,User2,Val3&lt;/P&gt;&lt;P&gt;01/03/2020,User3,Val1&lt;BR /&gt;01/04/2021,User3,Val2&lt;BR /&gt;01/06/2021,User3,Val3&lt;BR /&gt;01/03/2022,User3,Val4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Date column is a validity date. Let say for exemple that we are in July 2021, i want to filter the table to only keep the following lines:&lt;/P&gt;&lt;P&gt;User1, 01/01/2021, Val2&lt;/P&gt;&lt;P&gt;User2, 01/02/2020, Val1&lt;/P&gt;&lt;P&gt;User3, 01/06/2021, Val3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For&amp;nbsp; this, I setup a new table, filtering the existing User table with the following DAX Query.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FilteredUser = &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;D1&lt;/SPAN&gt;&lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;DATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;2021&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;07&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;01&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ADDCOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;User&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gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I add a rank column base on the date, and filter only rank==1, removing line also behind the validity.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is working well using a constant date in the DAX formula.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;What I would like now is to put a date slicer into my PBI.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And use the selected value of this slicer in my DAX expression.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I've create for this an independant Date Table. And bind my slicer to this date Table.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I've try to modify my DAX formula with something like:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Table1 = VAR D1= SELECTEDVALUE('Date'[Date])&lt;BR /&gt;RETURN FILTER(ADDCOLUMNS(User, "rank", RANKX(FILTER(User, User[Date]&amp;lt;=D1 &amp;amp;&amp;amp; [User] = EARLIER([User])), [Date],[Date],DESC,Dense)),[rank]==1 &amp;amp;&amp;amp; User[Date]&amp;lt;=D1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Also try with&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;VAR D1=&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'Date'[Date]&lt;/SPAN&gt;&lt;SPAN&gt; ) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But find no way to make it work.&lt;BR /&gt;It seems that I can't get the slicer value in this context.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Do you have any idea of how I can make this working ?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Here the PBI I use:&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="https://cegidgroup-my.sharepoint.com/:u:/g/personal/larnal_cegid_com/EY5ekSMiQq5DrXwbRLwXS2MBxfWiitKYA9x53YtJn2DESA?e=4a2QkP" target="_blank"&gt;https://cegidgroup-my.sharepoint.com/:u:/g/personal/larnal_cegid_com/EY5ekSMiQq5DrXwbRLwXS2MBxfWiitKYA9x53YtJn2DESA?e=4a2QkP&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Laurent.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&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>Fri, 10 Jun 2022 08:31:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2571145#M73435</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-10T08:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need help filtering data using DAX &amp; TimeSlicer,</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2571226#M73438</link>
      <description>&lt;P&gt;Calculated tables are not affected by slicers or filters as they are only calculated during data refresh. To achieve what you're after you could try creating a measure like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Show Data = IF( SELECTEDVALUE('User'[Date]) &amp;lt;= SELECTEDVALUE('Date'[Date]),1,0)&lt;/LI-CODE&gt;&lt;P&gt;and use that as a visual filter, to only show when the value is 1&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 08:45:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2571226#M73438</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-06-10T08:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need help filtering data using DAX &amp; TimeSlicer,</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2574470#M73650</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your quick answer.&lt;/P&gt;&lt;P&gt;Got it about the fact that calculated tables are not affect by slicer, and same for caculated column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try using a measure, but can't see how to achieve what I want.&lt;/P&gt;&lt;P&gt;A simple if condition will not work in my case because I want to keep not all line before the date, but the only first one before the date. Let say the date is for exemple 01/05/2021, it will filter for User3 only the line "&lt;SPAN&gt;01/04/2021,User3,Val2".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It was why i've used in my first exemple the Rank function that enable me to give an order on the value to do something like a topN filter. I can't see how I will be able to do the same using a measure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Laurent.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 08:31:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2574470#M73650</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-13T08:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need help filtering data using DAX &amp; TimeSlicer,</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2574780#M73666</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you write: "&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Let say for exemple that we are in July 2021, i want to filter the table to only keep the following lines:&lt;/P&gt;&lt;P&gt;User1, 01/01/2021, Val2&lt;/P&gt;&lt;P&gt;User2, 01/02/2020, Val1&lt;/P&gt;&lt;P&gt;User3, 01/06/2021, Val3", could you you explain your filtering logic (the criteria of filtering)?&amp;nbsp; If the criteria of filtering are clear, we can help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 09:49:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2574780#M73666</guid>
      <dc:creator>ManguilibeKAO</dc:creator>
      <dc:date>2022-06-13T09:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need help filtering data using DAX &amp; TimeSlicer,</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2574834#M73671</link>
      <description>&lt;P&gt;To clarify the criteria.&lt;/P&gt;&lt;P&gt;This is a table with historical data.&lt;/P&gt;&lt;P&gt;When you made calculation base on the table, you set a date [dt1] somewhere in the past.&lt;/P&gt;&lt;P&gt;The line to apply then for each user is the first one older to [dt1].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if I come back to my example, with a [dt1] set to 5/1/2021, you will keep in final result only those lines:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;01/01/2021,User1,Val2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;01/02/2020,User2,Val1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;01/04/2021,User3,Val2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hopes it make it clearer like this.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 10:03:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2574834#M73671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-13T10:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need help filtering data using DAX &amp; TimeSlicer,</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2579633#M73982</link>
      <description>&lt;P&gt;Hi，&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try follow steps:&lt;BR /&gt;1.create measue as below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;lastdate = 
VAR D1 =
    DATE ( 2021, 05, 01 )
RETURN
    CALCULATE (
        MAX ( User[Date] ),
        FILTER ( ALLEXCEPT ( User, User[User] ), User[Date] &amp;lt;= D1 )
    )
//Group by user and get max date less than or equal to current date&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;visual filter = IF(SELECTEDVALUE(User[Date])=[lastdate],1,0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.then drag&amp;nbsp; the measure 'visual filter' to the filter panle of this table visual as below:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 08:34:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2579633#M73982</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-06-15T08:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need help filtering data using DAX &amp; TimeSlicer,</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2607228#M75510</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the delay in my response, was on another stuff last weeks.&lt;BR /&gt;I test your solution today, it works great.&lt;BR /&gt;Exactly what I need.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Laurent.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 14:32:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-filtering-data-using-DAX-amp-TimeSlicer/m-p/2607228#M75510</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-28T14:32:59Z</dc:date>
    </item>
  </channel>
</rss>

