<?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: Grouped by time to maturity with between slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouped-by-time-to-maturity-with-between-slicer/m-p/3419017#M129403</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="501067" data-lia-user-login="Sahir_Maharaj" class="lia-mention lia-mention-user"&gt;Sahir_Maharaj&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sorry for the late reply.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I just tested your solution and it works smoothly, thank you for helping and taking your time to reply to my issue.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Best Regards.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2023 06:01:31 GMT</pubDate>
    <dc:creator>Solle</dc:creator>
    <dc:date>2023-09-07T06:01:31Z</dc:date>
    <item>
      <title>Grouped by time to maturity with between slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouped-by-time-to-maturity-with-between-slicer/m-p/3405884#M128686</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a table which requires me to group by time to maturity. This is done directly in Power Query where the "TimeToMaturity" is calculated by subtracting "As Of Date" with "MaturityDate". After this I have grouped them by adding a column named "MaturityBucketName" and "MaturityBucketID" with an if statement based on the column "TimeToMaturity" in the following categories:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;MaturityBucketName&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;MaturityBucketID&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Under 2.25 years to maturity&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Between 2.25 and 3.25&amp;nbsp;years to maturity&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Above 3.25 years to maturity&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my report all contracts is then grouped by these in a matrix, which consists of the following rows:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;MaturityBucketName&lt;/LI&gt;&lt;LI&gt;ContractID&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Then on the same page I have some other timeseries data, which is calculated using a between slicer, which also affects my ContractIDs as when they change groups in my grouping data, they are getting duplicated, so the same contract is now both in i.e. Between 2.25 and 3.25 years to maturity and under 2.25 years to maturity.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Does anyone know how to solve this issue, I have tried generating this in DAX with a max function on date, but it does not allow me to apply it on the row level?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Best Regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 06:28:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouped-by-time-to-maturity-with-between-slicer/m-p/3405884#M128686</guid>
      <dc:creator>Solle</dc:creator>
      <dc:date>2023-08-30T06:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped by time to maturity with between slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouped-by-time-to-maturity-with-between-slicer/m-p/3412179#M128998</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="371558" data-lia-user-login="Solle" class="lia-mention lia-mention-user"&gt;Solle&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;In Power Query, instead of directly calculating "TimeToMaturity" as a column, consider creating a calculated column that determines the "MaturityBucketID" based on the original "MaturityDate" and "As Of Date" columns.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;This calculated column should be assigned based on the criteria you specified (Under 2.25, Between 2.25 and 3.25, Above 3.25), using IF statements or custom functions.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Create a measure that calculates the maximum "MaturityBucketID" for each ContractID based on the filtered time range from the slicer.&amp;nbsp;When you're creating your matrix with "MaturityBucketName" and "ContractID" as rows, use the "MaxMaturityBucketID" measure as the values.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MaxMaturityBucketID = 
CALCULATE(
    MAX('YourTable'[MaturityBucketID]),
    ALLSELECTED('YourTable'),
    'YourTable'[As Of Date] &amp;gt;= MIN('DateSlicer'[StartDate]) &amp;amp;&amp;amp;
    'YourTable'[As Of Date] &amp;lt;= MAX('DateSlicer'[EndDate])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Should you require further details or information, please do not hesitate to reach out to me.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 20:14:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouped-by-time-to-maturity-with-between-slicer/m-p/3412179#M128998</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2023-09-02T20:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Grouped by time to maturity with between slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouped-by-time-to-maturity-with-between-slicer/m-p/3419017#M129403</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="501067" data-lia-user-login="Sahir_Maharaj" class="lia-mention lia-mention-user"&gt;Sahir_Maharaj&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sorry for the late reply.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I just tested your solution and it works smoothly, thank you for helping and taking your time to reply to my issue.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Best Regards.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 06:01:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouped-by-time-to-maturity-with-between-slicer/m-p/3419017#M129403</guid>
      <dc:creator>Solle</dc:creator>
      <dc:date>2023-09-07T06:01:31Z</dc:date>
    </item>
  </channel>
</rss>

