<?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 DAX for difference between each date and previous date per occurrence in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-difference-between-each-date-and-previous-date-per/m-p/3460989#M132012</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help with DAX to accomplish the following?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For&amp;nbsp; each vehicle many jobs are performed at various date intervals.&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Each time a job is performed, the date (JOB_OPEN_DATE) is captured. Below in the table you can see the&amp;nbsp;JOB_OPEN_DATEs when different jobs in the JOB column were performed at various dates for one selected vehicle. (There are of course many more vehicles.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;/U&gt; I don't want to display the actual date when each job was performed as you can see in the below table, but rather the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;difference&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt; between&amp;nbsp;each date and the previous date for each job - in number of days.&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp; This is to see clearly the interval (in days) at which the jobs were performed. This means e.g. for the first Job 06-02-005, &lt;SPAN&gt;2021 June should display (2021-06-23 minus 2020-06-17) =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;371&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(days). In the same way, 2022 July should display (2022-07-05 minus&amp;nbsp;2021-06-23) = &lt;STRONG&gt;377&lt;/STRONG&gt; (days).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The ideal solution should like like the below showing number of days:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;All the data is captured in the same WO WITH JOB DETAIL table. Here sample data from this table:&amp;nbsp;&lt;A href="https://docs.google.com/spreadsheets/d/1wEZdVVKoxqKYpYZvWcVNJuT91pjt8RUq/edit?usp=sharing&amp;amp;ouid=102372080420588402323&amp;amp;rtpof=true&amp;amp;sd=true" target="_blank" rel="noopener nofollow noreferrer"&gt;Sample dataset&lt;/A&gt;&amp;nbsp;. The data captured in Power BI is&amp;nbsp;&lt;A href="https://drive.google.com/file/d/111p0aU9zLoNnCV_ymGog_TW-YwIEPqLo/view?usp=sharing" target="_self" rel="nofollow noopener noreferrer"&gt;here.&lt;/A&gt;&amp;nbsp;Not sure if I should add a Date/Calendar table.&amp;nbsp;This &lt;A href="https://drive.google.com/file/d/1k_WWh5-LYs8Nt3f3_kmWELfsYlCaOPnm/view?usp=sharing" target="_self"&gt;Power Bi file&lt;/A&gt;&amp;nbsp; contains a date table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will note the interval between the various jobs differs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One would typically filter on a specific vehicle to monitor service intervals for its many jobs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Water&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2023 20:24:45 GMT</pubDate>
    <dc:creator>Water</dc:creator>
    <dc:date>2023-10-27T20:24:45Z</dc:date>
    <item>
      <title>DAX for difference between each date and previous date per occurrence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-difference-between-each-date-and-previous-date-per/m-p/3460989#M132012</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help with DAX to accomplish the following?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For&amp;nbsp; each vehicle many jobs are performed at various date intervals.&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Each time a job is performed, the date (JOB_OPEN_DATE) is captured. Below in the table you can see the&amp;nbsp;JOB_OPEN_DATEs when different jobs in the JOB column were performed at various dates for one selected vehicle. (There are of course many more vehicles.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;/U&gt; I don't want to display the actual date when each job was performed as you can see in the below table, but rather the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;difference&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt; between&amp;nbsp;each date and the previous date for each job - in number of days.&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp; This is to see clearly the interval (in days) at which the jobs were performed. This means e.g. for the first Job 06-02-005, &lt;SPAN&gt;2021 June should display (2021-06-23 minus 2020-06-17) =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;371&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(days). In the same way, 2022 July should display (2022-07-05 minus&amp;nbsp;2021-06-23) = &lt;STRONG&gt;377&lt;/STRONG&gt; (days).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The ideal solution should like like the below showing number of days:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;All the data is captured in the same WO WITH JOB DETAIL table. Here sample data from this table:&amp;nbsp;&lt;A href="https://docs.google.com/spreadsheets/d/1wEZdVVKoxqKYpYZvWcVNJuT91pjt8RUq/edit?usp=sharing&amp;amp;ouid=102372080420588402323&amp;amp;rtpof=true&amp;amp;sd=true" target="_blank" rel="noopener nofollow noreferrer"&gt;Sample dataset&lt;/A&gt;&amp;nbsp;. The data captured in Power BI is&amp;nbsp;&lt;A href="https://drive.google.com/file/d/111p0aU9zLoNnCV_ymGog_TW-YwIEPqLo/view?usp=sharing" target="_self" rel="nofollow noopener noreferrer"&gt;here.&lt;/A&gt;&amp;nbsp;Not sure if I should add a Date/Calendar table.&amp;nbsp;This &lt;A href="https://drive.google.com/file/d/1k_WWh5-LYs8Nt3f3_kmWELfsYlCaOPnm/view?usp=sharing" target="_self"&gt;Power Bi file&lt;/A&gt;&amp;nbsp; contains a date table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will note the interval between the various jobs differs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One would typically filter on a specific vehicle to monitor service intervals for its many jobs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Water&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 20:24:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-difference-between-each-date-and-previous-date-per/m-p/3460989#M132012</guid>
      <dc:creator>Water</dc:creator>
      <dc:date>2023-10-27T20:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for difference between each date and previous date per occurrence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-difference-between-each-date-and-previous-date-per/m-p/3464737#M132212</link>
      <description>&lt;P&gt;This is not giving you what you asked for, but probably what you wanted.&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>Fri, 06 Oct 2023 22:36:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-difference-between-each-date-and-previous-date-per/m-p/3464737#M132212</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-10-06T22:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for difference between each date and previous date per occurrence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-difference-between-each-date-and-previous-date-per/m-p/3502093#M134317</link>
      <description>&lt;P&gt;Thank you very much for an inbetween solution!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, idealy I still hope for an output like the below in days difference:&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;&lt;P&gt;Updated the &lt;A href="https://drive.google.com/file/d/1k_WWh5-LYs8Nt3f3_kmWELfsYlCaOPnm/view?usp=sharing" target="_self"&gt;Power BI file&lt;/A&gt; with a better date relatonships now that I understand that better.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you mind to please have another look?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With hope and thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Water&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 20:31:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-difference-between-each-date-and-previous-date-per/m-p/3502093#M134317</guid>
      <dc:creator>Water</dc:creator>
      <dc:date>2023-10-27T20:31:04Z</dc:date>
    </item>
  </channel>
</rss>

