<?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 How to calculate average working days of closed tickets? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-working-days-of-closed-tickets/m-p/1389364#M25428</link>
    <description>&lt;P&gt;So, I am new to Power BI and my database is a bit weird. it looks like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;```&lt;BR /&gt;Ticket&amp;nbsp; &amp;nbsp; &amp;nbsp; Open Date&amp;nbsp; &amp;nbsp; &amp;nbsp; Close Date&lt;BR /&gt;BR001&amp;nbsp; &amp;nbsp; &amp;nbsp; 02/01/2020&amp;nbsp; &amp;nbsp; 02/01/2020&lt;BR /&gt;BR001&amp;nbsp; &amp;nbsp; &amp;nbsp; 02/01/2020&amp;nbsp; &amp;nbsp; 10/01/2020&lt;BR /&gt;BR001&amp;nbsp; &amp;nbsp; &amp;nbsp; 12/02/2020&amp;nbsp; &amp;nbsp; 14/02/2020&lt;BR /&gt;BR002&amp;nbsp; &amp;nbsp; &amp;nbsp; 02/02/2020&amp;nbsp; &amp;nbsp; 04/02/2020&lt;BR /&gt;BR002&amp;nbsp; &amp;nbsp; &amp;nbsp;05/02/2020&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason it looks like this is that because some tickets are reopened up to 5-6 times. If the last row of the ticket does not contain a closing date, it means the ticket is still open for the time being. The result that would be ideal to me (I don't know if it's even possible) is to have 8 working average days for the first ticket in a matrix or table (excluding weekends) and not taking into account the second ticket since it's still open.&amp;nbsp;&lt;SPAN&gt;It should be 8 because the first line is one day, the 2nd January, then from the second till the tenth it should be 8 days, but on the calendar there are 2 days weekends, so it's technically 6 days. Since the first line started with the 2nd of January and ended the same day, and the second line started with the 2nd again, it should be counted as one day, not two. Then finally there are the two days in February which makes a total of 8 days. I hope that's clear enough.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The desired output should look something like:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;```&lt;BR /&gt;Ticket&amp;nbsp; &amp;nbsp; &amp;nbsp; Average working days&lt;BR /&gt;BR001&amp;nbsp; &amp;nbsp; &amp;nbsp;8 Days&lt;BR /&gt;BR002&amp;nbsp; &amp;nbsp; &amp;nbsp;null&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Is it possible to have a result like that? Or what would be the closest thing to it? I am also open to transform the data with M-Query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 23 Sep 2020 07:10:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-23T07:10:36Z</dc:date>
    <item>
      <title>How to calculate average working days of closed tickets?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-working-days-of-closed-tickets/m-p/1389364#M25428</link>
      <description>&lt;P&gt;So, I am new to Power BI and my database is a bit weird. it looks like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;```&lt;BR /&gt;Ticket&amp;nbsp; &amp;nbsp; &amp;nbsp; Open Date&amp;nbsp; &amp;nbsp; &amp;nbsp; Close Date&lt;BR /&gt;BR001&amp;nbsp; &amp;nbsp; &amp;nbsp; 02/01/2020&amp;nbsp; &amp;nbsp; 02/01/2020&lt;BR /&gt;BR001&amp;nbsp; &amp;nbsp; &amp;nbsp; 02/01/2020&amp;nbsp; &amp;nbsp; 10/01/2020&lt;BR /&gt;BR001&amp;nbsp; &amp;nbsp; &amp;nbsp; 12/02/2020&amp;nbsp; &amp;nbsp; 14/02/2020&lt;BR /&gt;BR002&amp;nbsp; &amp;nbsp; &amp;nbsp; 02/02/2020&amp;nbsp; &amp;nbsp; 04/02/2020&lt;BR /&gt;BR002&amp;nbsp; &amp;nbsp; &amp;nbsp;05/02/2020&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason it looks like this is that because some tickets are reopened up to 5-6 times. If the last row of the ticket does not contain a closing date, it means the ticket is still open for the time being. The result that would be ideal to me (I don't know if it's even possible) is to have 8 working average days for the first ticket in a matrix or table (excluding weekends) and not taking into account the second ticket since it's still open.&amp;nbsp;&lt;SPAN&gt;It should be 8 because the first line is one day, the 2nd January, then from the second till the tenth it should be 8 days, but on the calendar there are 2 days weekends, so it's technically 6 days. Since the first line started with the 2nd of January and ended the same day, and the second line started with the 2nd again, it should be counted as one day, not two. Then finally there are the two days in February which makes a total of 8 days. I hope that's clear enough.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The desired output should look something like:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;```&lt;BR /&gt;Ticket&amp;nbsp; &amp;nbsp; &amp;nbsp; Average working days&lt;BR /&gt;BR001&amp;nbsp; &amp;nbsp; &amp;nbsp;8 Days&lt;BR /&gt;BR002&amp;nbsp; &amp;nbsp; &amp;nbsp;null&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Is it possible to have a result like that? Or what would be the closest thing to it? I am also open to transform the data with M-Query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 07:10:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-working-days-of-closed-tickets/m-p/1389364#M25428</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-23T07:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average working days of closed tickets?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-working-days-of-closed-tickets/m-p/1389427#M25431</link>
      <description>That's not as hard as one might think. You just have to expand the intervals into real days, one by one, for each ticket and take the DISTINCT days. Once you have such a table, get rid of the weekends from it and voila!, you've got what you need. Then the working days will be the count of the days in such a table. Of course, the same technique works for Power Query as well as DAX. And it can be made dynamic, if you don't want to transform your table.</description>
      <pubDate>Wed, 23 Sep 2020 07:23:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-working-days-of-closed-tickets/m-p/1389427#M25431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-23T07:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average working days of closed tickets?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-working-days-of-closed-tickets/m-p/1389651#M25444</link>
      <description>&lt;P&gt;Thanks a lot for your suggestion! But is it possible if you show me how in detail? Maybe with screenshots or a sample file? As I said, I am very new to Power BI and I still don't know how everything works&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 08:40:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-working-days-of-closed-tickets/m-p/1389651#M25444</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-23T08:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average working days of closed tickets?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-working-days-of-closed-tickets/m-p/1389927#M25460</link>
      <description>I don't have the time to do it in detail and I can't post files as I'm at work and have restrictions. You should create a table with expanded intervals. Instead of&lt;BR /&gt;BR001 02/01/2020 02/01/2020&lt;BR /&gt;BR001 02/01/2020 10/01/2020&lt;BR /&gt;you should create&lt;BR /&gt;BR001 02/01/2020&lt;BR /&gt;BR001 03/01/2020&lt;BR /&gt;BR001 04/01/2020&lt;BR /&gt;...&lt;BR /&gt;BR001 10/01/2020&lt;BR /&gt;Can you see it? If you expand the intervals into separate days and then take only the distinct combinations of (ticket, day), you can easily get rid of weekends as well from this and then for each ticket you've got the effective days. What you then have to do is to count them.&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Sep 2020 10:24:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-working-days-of-closed-tickets/m-p/1389927#M25460</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-23T10:24:42Z</dc:date>
    </item>
  </channel>
</rss>

