<?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: Time Intelligence Invoice Date &amp;amp; Invoice Pay Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Intelligence-Invoice-Date-amp-Invoice-Pay-Date/m-p/1867850#M40008</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="248215" data-lia-user-login="cdawidow" class="lia-mention lia-mention-user"&gt;cdawidow&lt;/a&gt; , ate you trying to look for an age bucket?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if they are from same table we can create&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New column =&lt;/P&gt;
&lt;P&gt;var _age = datediff([invoice Date], [paid date], day)&lt;/P&gt;
&lt;P&gt;return&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Switch(True() ,&lt;/P&gt;
&lt;P&gt;_age &amp;lt;20, "&amp;nbsp; Below 20" ,&lt;/P&gt;
&lt;P&gt;_age &amp;lt;30 , " Between 20-30",&lt;/P&gt;
&lt;P&gt;//Add others&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if these are not from the same table then you need to measure&amp;nbsp;&lt;/P&gt;
&lt;P&gt;datediff(Min(Table[invoice Date]), Max(Table2[paid date]), day)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you need to do segmentation or binning using an independent table&lt;/P&gt;
&lt;P&gt;Dynamic Segmentation, Bucketing or Binning: &lt;A href="https://youtu.be/CuczXPj0N-k" target="_blank"&gt;https://youtu.be/CuczXPj0N-k&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 May 2021 14:23:38 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-05-27T14:23:38Z</dc:date>
    <item>
      <title>Time Intelligence Invoice Date &amp; Invoice Pay Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Intelligence-Invoice-Date-amp-Invoice-Pay-Date/m-p/1867505#M39995</link>
      <description>&lt;P&gt;Hi guys, just running into a brick wall here.&amp;nbsp; My A/R team groups invoices by the month they were eventually paid and not by days.&amp;nbsp; So for example.&amp;nbsp; An invoice that was Invoiced in February 17th 2020 and was paid on March 22 2020 would be grouped in AGE 1. Following the same example, if the invoice was paid on April it would be grouped in AGE 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is how to use DAX to follow this logic so I get the right invoice amounts for these aged groups?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following but its not coming out right.&amp;nbsp; Date is my date table.&amp;nbsp; I have in&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cluded the relationship set up below between the date table and A/R table.&amp;nbsp; Any help would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AGE 2 = VAR X = FIRSTDATE('DATE'[Date]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Y = CALCULATE(LASTDATE('DATE'[Date]),DATEADD('DATE'[Date],2,MONTH)) RETURN CALCULATE(SUM('A/R'[INVAM]),FILTER('A/R','A/R'[INVOICE DATE]&amp;gt;=X &amp;amp;&amp;amp; 'A/R'[INVOICE PAY DATE]&amp;lt;=Y))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 May 2021 12:14:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Intelligence-Invoice-Date-amp-Invoice-Pay-Date/m-p/1867505#M39995</guid>
      <dc:creator>cdawidow</dc:creator>
      <dc:date>2021-05-27T12:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intelligence Invoice Date &amp; Invoice Pay Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Intelligence-Invoice-Date-amp-Invoice-Pay-Date/m-p/1867850#M40008</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="248215" data-lia-user-login="cdawidow" class="lia-mention lia-mention-user"&gt;cdawidow&lt;/a&gt; , ate you trying to look for an age bucket?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if they are from same table we can create&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New column =&lt;/P&gt;
&lt;P&gt;var _age = datediff([invoice Date], [paid date], day)&lt;/P&gt;
&lt;P&gt;return&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Switch(True() ,&lt;/P&gt;
&lt;P&gt;_age &amp;lt;20, "&amp;nbsp; Below 20" ,&lt;/P&gt;
&lt;P&gt;_age &amp;lt;30 , " Between 20-30",&lt;/P&gt;
&lt;P&gt;//Add others&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if these are not from the same table then you need to measure&amp;nbsp;&lt;/P&gt;
&lt;P&gt;datediff(Min(Table[invoice Date]), Max(Table2[paid date]), day)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you need to do segmentation or binning using an independent table&lt;/P&gt;
&lt;P&gt;Dynamic Segmentation, Bucketing or Binning: &lt;A href="https://youtu.be/CuczXPj0N-k" target="_blank"&gt;https://youtu.be/CuczXPj0N-k&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:23:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Intelligence-Invoice-Date-amp-Invoice-Pay-Date/m-p/1867850#M40008</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-05-27T14:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intelligence Invoice Date &amp; Invoice Pay Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Intelligence-Invoice-Date-amp-Invoice-Pay-Date/m-p/1867867#M40010</link>
      <description>&lt;P&gt;You've got 2 date fields in the main table so you have to either disconnect your Date table from it or have 2 relationships between the tables out of which one will be inactive and activated with USERELATIONSHIP within a measure. Or, you could have 2 different Date tables, one for invoice date and the other one for invoice payment day. What you choose depends on what you want to calculate in your model. If you want to be able to show on one time axis the number of invoices raised and paid, then you should opt for one Date table with either no connection to the main table or 2 connections (one inactive).&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:30:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Intelligence-Invoice-Date-amp-Invoice-Pay-Date/m-p/1867867#M40010</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-27T14:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intelligence Invoice Date &amp; Invoice Pay Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Intelligence-Invoice-Date-amp-Invoice-Pay-Date/m-p/1867883#M40011</link>
      <description>&lt;P&gt;Hi Amit, I am and I understand your measure.&amp;nbsp; But my orginization focuses on the month the invoice is actually paid and not the days.&amp;nbsp; For example. if a invoice is Issued in Feb but payed sometime in March then that would be in AGE 1.&amp;nbsp; If that same invoice was paid in April, it would be Age 2 because it is paid in the month of April, 2 months after the issue month of February.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:37:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Time-Intelligence-Invoice-Date-amp-Invoice-Pay-Date/m-p/1867883#M40011</guid>
      <dc:creator>cdawidow</dc:creator>
      <dc:date>2021-05-27T14:37:47Z</dc:date>
    </item>
  </channel>
</rss>

