<?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: Getting Max Date based on slicer selection  and Use That to get difference between 2 dates.. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1214084#M19583</link>
    <description>&lt;P class="lia-align-justify"&gt;Thanks ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp; It&amp;nbsp; worked for me.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 08:39:20 GMT</pubDate>
    <dc:creator>PBI_Publisher</dc:creator>
    <dc:date>2020-07-10T08:39:20Z</dc:date>
    <item>
      <title>Getting Max Date based on slicer selection  and Use That to get difference between 2 dates..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1211993#M19523</link>
      <description>&lt;P&gt;Hi DAX Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm kind of struggling to achieve a result using dax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Formula's used to achieve:&lt;/P&gt;&lt;P&gt;MaxDate = var maxselected=CALCULATE(MAX('Date'[Date]))return if(ISFILTERED('Date'[Year]),maxselected)&lt;BR /&gt;Ageing is := DATEDIFF(Sheet1[ShortCreatedDate],[MaxDate],DAY)&lt;BR /&gt;AverageAge: AvgAge = AVERAGE(Sheet1[ageing])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Requirement it to calculate the average age of ticket, but based on slicer selection.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1.If a year is seleted the ageing should be calculated as difference of created date and the last date available month of the selected year.&lt;BR /&gt;2.If a year &amp;amp; Quarter is seleted the ageing should be calculated as difference of created date and the last date available month of the selected quarter for that particular year.&lt;BR /&gt;3.If a year &amp;amp; Quarter &amp;amp; Month is seleted the ageing should be calculated as difference of created date and the last date available month of the selected month for that particular year &amp;amp; Quarter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As part of my Trial to achieve the same i have used max date measure which i feel is giving the last date based on th selected slicer.&lt;/P&gt;&lt;P&gt;The part where i'm getting confused is when i use the measure to find the ageing I'm getting Blank as value.&lt;/P&gt;&lt;P&gt;Can someone please point me in the right direction to get the desired value.&lt;/P&gt;&lt;P&gt;Have also attached the screen shot &amp;amp; PBIX file in the below link.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://drive.google.com/file/d/1quH8cDAUpESthO6qx09Bji6whWn6M7fq/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1quH8cDAUpESthO6qx09Bji6whWn6M7fq/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 13:22:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1211993#M19523</guid>
      <dc:creator>PBI_Publisher</dc:creator>
      <dc:date>2020-07-09T13:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Max Date based on slicer selection  and Use That to get difference between 2 dates..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1212627#M19545</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="118574" data-lia-user-login="PBI_Publisher" class="lia-mention lia-mention-user"&gt;PBI_Publisher&lt;/a&gt; , As long as a month, qtr are selected from date table it will be taken care.&lt;/P&gt;
&lt;P&gt;You need to take care of row context&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;measure = &lt;BR /&gt;var _max = MAXX(allselected('Date'),'Date'[Date])&lt;/P&gt;
&lt;P&gt;return DATEDIFF(max(Sheet1[ShortCreatedDate]),_max,DAY)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for row context refer&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Difference-Across/ba-p/934397#M451" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Difference-Across/ba-p/934397#M451&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 16:54:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1212627#M19545</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-09T16:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Max Date based on slicer selection  and Use That to get difference between 2 dates..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1214084#M19583</link>
      <description>&lt;P class="lia-align-justify"&gt;Thanks ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp; It&amp;nbsp; worked for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 08:39:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1214084#M19583</guid>
      <dc:creator>PBI_Publisher</dc:creator>
      <dc:date>2020-07-10T08:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Max Date based on slicer selection  and Use That to get difference between 2 dates..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1221507#M19826</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last idea which u suggested worked for me. Adding to that i have a requirement where after finding the difference of between the dates. I need to put the value into a calculated colum/Measure where it will be grouped in the below format based on the days difference of 2 dates i need to make a bucket. (0-3 days, 4-7 days...&amp;nbsp; like this).&lt;/P&gt;&lt;P&gt;Can You please help me in achieveing this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 12:58:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1221507#M19826</guid>
      <dc:creator>PBI_Publisher</dc:creator>
      <dc:date>2020-07-14T12:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Max Date based on slicer selection  and Use That to get difference between 2 dates..</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1223473#M19883</link>
      <description>&lt;P&gt;I think i'm missing something silly here&amp;nbsp; i tried achieveing it&amp;nbsp; but it always shows me difference from current day not from the selected month last day. What could be the problem here? Can someone please guide me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thnaks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 05:36:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Max-Date-based-on-slicer-selection-and-Use-That-to-get/m-p/1223473#M19883</guid>
      <dc:creator>PBI_Publisher</dc:creator>
      <dc:date>2020-07-15T05:36:40Z</dc:date>
    </item>
  </channel>
</rss>

