<?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 Dynamically calculate max and min time based on time slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/954762#M10884</link>
    <description>&lt;P&gt;Hello Need help with DAX. I am trying to calculate max time and min time of the submissions made. from the submission date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a measure to calculate the max time and min time using the below syntax.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Min time = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN(Baseline_Append_new_group_index[Submission date]) ,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALLEXCEPT(Baseline_Append_new_group_index ,Baseline_Append_new_group_index[Index]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I want this max and min time to be dynamic with the submission date which I am using in the slicer. I want to filter the records which would calculate the max and min time which falls into the slicer range. I am using max and min time to make further calculations of Delta of values between the MAX and MIN time. Currently, MAX and MIN time are static, how to make them dynamic with the slicer selection.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please find below the snapshot of data.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I am using submission date in the slicer. I need the min time and max time to be calculated dynamically based on the date range selected in the slicer. I have been struggling with this since past few&amp;nbsp; days and any help will be apprecaiated. Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2020 07:24:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-02T07:24:36Z</dc:date>
    <item>
      <title>Dynamically calculate max and min time based on time slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/954762#M10884</link>
      <description>&lt;P&gt;Hello Need help with DAX. I am trying to calculate max time and min time of the submissions made. from the submission date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a measure to calculate the max time and min time using the below syntax.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Min time = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN(Baseline_Append_new_group_index[Submission date]) ,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALLEXCEPT(Baseline_Append_new_group_index ,Baseline_Append_new_group_index[Index]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I want this max and min time to be dynamic with the submission date which I am using in the slicer. I want to filter the records which would calculate the max and min time which falls into the slicer range. I am using max and min time to make further calculations of Delta of values between the MAX and MIN time. Currently, MAX and MIN time are static, how to make them dynamic with the slicer selection.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please find below the snapshot of data.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I am using submission date in the slicer. I need the min time and max time to be calculated dynamically based on the date range selected in the slicer. I have been struggling with this since past few&amp;nbsp; days and any help will be apprecaiated. Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 07:24:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/954762#M10884</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-02T07:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically calculate max and min time based on time slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/954828#M10889</link>
      <description>&lt;P&gt;Create one date dimension&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calender(date(2016,1,1),date(2020,12,31))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use this date dimension in slicer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Modify measure&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Min time =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN(Baseline_Append_new_group_index[Submission date]) ,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALLEXCEPT(Baseline_Append_new_group_index ,Baseline_Append_new_group_index[Index])&lt;BR /&gt;Filter(Baseline_Append_new_group_index,Baseline_Append_new_group_index[Submission date]&amp;gt;=min(Date[calender date]) &amp;amp;&amp;amp; Baseline_Append_new_group_index[Submission date] &amp;lt;=max(Date[calender date])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks &amp;amp; regards,&lt;BR /&gt;Pravin Wattamwar&lt;BR /&gt;&lt;A href="http://www.linkedin.com/in/pravin-p-wattamwar" target="_blank"&gt;www.linkedin.com/in/pravin-p-wattamwar&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If I resolve your problem Mark it as a solution and give kudos.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Mar 2020 08:05:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/954828#M10889</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-02T08:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically calculate max and min time based on time slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/955487#M10931</link>
      <description>&lt;P&gt;I tried the solution, but it gives me the same max time and min time as the submission date as shown below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;As you can see in the image, after trying the solution, it gives the same min time and max time as the submission date. I can give you a used case, Lets say they make 10 submissions in the given time frame we select in the slicer. I need a submission closest to the start date of the slicer, and one closest to the end date of the slicer. Then I need to use the 2 submissions to calculate delta of a measure between those 2 submissions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used the below code to calculate the max time and min time as mentioned earlier.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Min time = 
    CALCULATE(
        MIN(Baseline_Append_new_group_index[Submission date])  ,
        ALLEXCEPT(Baseline_Append_new_group_index ,Baseline_Append_new_group_index[Index]),
        FILTER(Baseline_Append_new_group_index,Baseline_Append_new_group_index[Submission date] &amp;gt;= MIN('Date'[Date]) &amp;amp;&amp;amp; Baseline_Append_new_group_index[Submission date] &amp;lt;= MAX('Date'[Date]))) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for max time,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Max time = 
    CALCULATE(
        MAX(Baseline_Append_new_group_index[Submission date]) ,
        ALLEXCEPT(Baseline_Append_new_group_index ,Baseline_Append_new_group_index[Index]),
        FILTER(Baseline_Append_new_group_index,Baseline_Append_new_group_index[Submission date] &amp;gt;= MIN('Date'[Date]) &amp;amp;&amp;amp; Baseline_Append_new_group_index[Submission date] &amp;lt;= MAX('Date'[Date])))
        &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I use these time stamps to calulate the difference between the 2 submissions as below.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Net Head Count Delta(Index) = CALCULATE(SUM(Baseline_Append_new_group_index[Net Head Count Change]),FILTER(Baseline_Append_new_group_index,Baseline_Append_new_group_index[Submission date] = [Max time])) -CALCULATE(SUM(Baseline_Append_new_group_index[Net Head Count Change]),FILTER(Baseline_Append_new_group_index,Baseline_Append_new_group_index[Submission date] = [Min time]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am just missing something very simple, or it is more complicated to acheive the results. All the help is highly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bharat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 15:50:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/955487#M10931</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-02T15:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically calculate max and min time based on time slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/956544#M10993</link>
      <description>&lt;P&gt;Could you share your dataset in text?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Copy it in excel and copy it from there and paste here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure which i have suggested should work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You want max and min date per index for slicer selected date right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pravin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 08:25:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/956544#M10993</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-03T08:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically calculate max and min time based on time slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/956557#M10996</link>
      <description>&lt;P&gt;try this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Min time =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MIN(Baseline_Append_new_group_index[Submission date]) ,&lt;BR /&gt;ALLEXCEPT(Baseline_Append_new_group_index ,Baseline_Append_new_group_index[Index],Baseline_Append_new_group_index[Account name],Baseline_Append_new_group_index[offering]),&lt;BR /&gt;FILTER(Baseline_Append_new_group_index,Baseline_Append_new_group_index[Submission date] &amp;gt;= MIN('Date'[Date]) &amp;amp;&amp;amp; Baseline_Append_new_group_index[Submission date] &amp;lt;= MAX('Date'[Date])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;similarly add other columns in allexcept function for max time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pravin&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 08:39:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-calculate-max-and-min-time-based-on-time-slicer/m-p/956557#M10996</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-03T08:39:46Z</dc:date>
    </item>
  </channel>
</rss>

