<?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: Filter function with time segment in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1623089#M32775</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Ranks function continues to calculate on all dates without taking into account my min_ and max_ variables that I have integrated in my filter function. I shared my pbix so that it is more meaningful.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2021 09:21:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-01-26T09:21:22Z</dc:date>
    <item>
      <title>Filter function with time segment</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1611786#M32400</link>
      <description>&lt;P&gt;Hello to all,&lt;/P&gt;&lt;P&gt;First of all here is my data table :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I would like to modify the "Filter" function of this measure :&lt;BR /&gt;Index_Arrets_Turbidity = RANKX(FILTER(ALL(fact_points_measures_faucon), fact_points_measures_faucon[id_measure_faucon]=370 &amp;amp;&amp;amp; fact_points_measures_faucon[dt (1j)]&amp;gt;=DATE(2020,9, 1) &amp;amp;&amp;amp; fact_points_measurements_faucon[dt (1d)]&amp;lt;=DATE(2020,12,1) ), CALCULATE(AVERAGE(fact_points_measurements_faucon[Index]),dim_measurements_faucon[group_measurement]="Turbidity"),,ASC,Skip)&lt;BR /&gt;I would like the values of DATE() not to be filled in manually but to be filled in automatically according to my time segment :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joël&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 16:54:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1611786#M32400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-20T16:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter function with time segment</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1612071#M32413</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Index_Arrets_Turbidity =
VAR min_ =
    MIN ( DateT[Date] )
VAR max_ =
    MAX ( DateT[Date] )
RETURN
    RANKX (
        FILTER (
            ALL ( fact_points_measures_faucon ),
            fact_points_measures_faucon[id_measure_faucon] = 370
                &amp;amp;&amp;amp; fact_points_measures_faucon[dt (1j)] &amp;gt;= min_
                &amp;amp;&amp;amp; fact_points_measurements_faucon[dt (1d)] &amp;lt;= max_
        ),
        CALCULATE (
            AVERAGE ( fact_points_measurements_faucon[Index] ),
            dim_measurements_faucon[group_measurement] = "Turbidity"
        ),
        ,
        ASC,
        SKIP
    )
&lt;/LI-CODE&gt;
&lt;P&gt;where DateT[Date] is the field you are using in the slicer&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 18:45:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1612071#M32413</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2021-01-20T18:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filter function with time segment</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1621360#M32713</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll contact you again regarding the same problem because the solution you kindly wrote to me doesn't work anymore. To make it easier, I am attaching the PBIX in the following link :&amp;nbsp;&lt;A title="pbix" href="https://1drv.ms/u/s!Ao1OrcTeY008gYU2OOM2oBSrDBzgpQ?e=1uVQAg" target="_self"&gt;https://1drv.ms/u/s!Ao1OrcTeY008gYU2OOM2oBSrDBzgpQ?e=1uVQAg&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help,&lt;/P&gt;&lt;P&gt;Joël&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 15:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1621360#M32713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-25T15:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Filter function with time segment</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1622264#M32743</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need more info.What exactly doesn't work?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 00:41:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1622264#M32743</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2021-01-26T00:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filter function with time segment</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1623089#M32775</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Ranks function continues to calculate on all dates without taking into account my min_ and max_ variables that I have integrated in my filter function. I shared my pbix so that it is more meaningful.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 09:21:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1623089#M32775</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-26T09:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Filter function with time segment</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1623260#M32785</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're not explaining what the expected result is and why, so I cannot check the result. In any case, it looks like youa renot following the pattern we developed earlier. You are seemingly ignoring the effects of context transition. Try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Index_Arrets_Turbidity V2 = 
VAR firstDate_ = [First date]
VAR lastDate_ = [Last date]
RETURN
RANKX (
        FILTER (
            ALL ( fact_points_mesures_faucon ),
            fact_points_mesures_faucon[id_mesure_faucon] = 370
                &amp;amp;&amp;amp; fact_points_mesures_faucon[dt (1j)] &amp;gt;= firstDate_
                &amp;amp;&amp;amp; fact_points_mesures_faucon[dt (1j)] &amp;lt;= lastDate_
        ),
        CALCULATE (
            AVERAGE ( fact_points_mesures_faucon[Index] ),
            dim_mesure_faucon[groupement_mesure] ="Turbidité"
        ),
        ,
        ASC,
        SKIP
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 10:09:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1623260#M32785</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2021-01-26T10:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filter function with time segment</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1623342#M32790</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;What I would like to have is a Ranks function that automatically recalculates itself according to the time segment.&lt;BR /&gt;Roughly the same result as this function:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But without using "ALLSELECTED" because this function truncates the result of the other measurements that are related to it.&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joël&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 10:38:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-function-with-time-segment/m-p/1623342#M32790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-26T10:38:58Z</dc:date>
    </item>
  </channel>
</rss>

