<?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: Differenza tra due date per calcolo tempo produttivo in Power BI in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524511#M29806</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what is the &lt;STRONG&gt;expected result&lt;/STRONG&gt; in your example above?? I understand you want a calculated column in that table. If so, what values would it have in the example? So that I can be completely clear on what the&amp;nbsp;requirements are. Grazie&lt;/P&gt;
&lt;TABLE border="1" width="568px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="105.967px"&gt;&lt;STRONG&gt;programma&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="153.767px"&gt;
&lt;P&gt;&lt;STRONG&gt;Ora inizio&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="153.767px"&gt;&lt;STRONG&gt;Ora fine&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="153.7px"&gt;Expected result&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105.967px"&gt;ABC-Program&lt;/TD&gt;
&lt;TD width="153.767px"&gt;21/01/2020 08:00:00&lt;/TD&gt;
&lt;TD width="153.767px"&gt;22/01/2020 09:30:00&lt;/TD&gt;
&lt;TD width="153.7px"&gt;&lt;FONT color="#FF0000"&gt;????&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105.967px"&gt;DEF-Program&lt;/TD&gt;
&lt;TD width="153.767px"&gt;22/01/2020 10:00:00&lt;/TD&gt;
&lt;TD width="153.767px"&gt;27/01/2020 12:45:00&lt;/TD&gt;
&lt;TD width="153.7px"&gt;&lt;FONT color="#FF0000"&gt;????&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2020 16:02:45 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2020-11-30T16:02:45Z</dc:date>
    <item>
      <title>Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1452543#M27286</link>
      <description>&lt;P&gt;ho una tabella che contiene tra i vari campi anche data_inizio_lavorazione ('ddmmyy hh24:min:sec), data_fine_lavorazione ('ddmmyy hh24:min:sec').&lt;BR /&gt;quello che devo fare è calcolare il tempo di produzione che intercorre tra queste due date. il problema è:&lt;BR /&gt;1. possono essere anche due date di due giorni diversi&lt;BR /&gt;2. se faccio la differenza di queste due date mi conta un giorno normale di 24 ore&lt;BR /&gt;3. la macchina lavora 8 ore al giorno&lt;BR /&gt;4. devo escludere da questo calcolo gli eventuali sabati e domeniche.&lt;/P&gt;&lt;P&gt;come posso fare per calcolarmi questo tempo?&lt;BR /&gt;grazie&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 15:12:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1452543#M27286</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-23T15:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1452632#M27292</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share the pbix so that we can run a couple of tests? Or at least a sample of your data and show an example based on that data with the expected result&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 16:15:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1452632#M27292</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-10-23T16:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1457759#M27447</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thank you for your time.&lt;/P&gt;&lt;P&gt;the problem is that i can't calculate the time between two date. i need to exclude the weekend and the hours that the machine is off.&lt;/P&gt;&lt;P&gt;attached the example of the file that i normally use.&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;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm not able to upload the PBIX file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you send me your email, i would like to send the PBIX to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tnks&lt;/P&gt;&lt;P&gt;Alberto&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 09:49:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1457759#M27447</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-27T09:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1457902#M27450</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can share here the URL to the file hosted elsewhere: Dropbox, Onedrive... or just upload the file to a site like &lt;A href="http://www.tinyupload.com" target="_self"&gt;tinyupload.com&lt;/A&gt; (no sign-up required). OR you send me the URL by private message here on the platform&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 10:41:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1457902#M27450</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-10-27T10:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1458109#M27459</link>
      <description>&lt;P&gt;Ok this is the PBIX file&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/2ucn15ghevpxwtd/DASHBOARD%20PRODUZIONE.pbix?dl=0" target="_blank"&gt;https://www.dropbox.com/s/2ucn15ghevpxwtd/DASHBOARD%20PRODUZIONE.pbix?dl=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;write me at albertosimonetto95@gmail.com for any clarification.&lt;/P&gt;&lt;P&gt;tnks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alberto&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 12:04:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1458109#M27459</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-27T12:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524335#M29798</link>
      <description>&lt;P&gt;Can someone help me?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 13:43:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524335#M29798</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-30T13:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524394#M29800</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, I must have missed your previous message. &lt;/P&gt;
&lt;P&gt;Now that I have the pbix, can you please explain again what you need &lt;STRONG&gt;with an example&lt;/STRONG&gt; based on the data in the file you've shared. So that it is clear. I do not see a column "ata_inizio_lavorazione" in the file, for instance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 14:01:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524394#M29800</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-11-30T14:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524405#M29801</link>
      <description>&lt;P&gt;hi AIB,&lt;/P&gt;&lt;P&gt;how are you?&lt;/P&gt;&lt;P&gt;the problem is that a cannot calculate the difference fìbetween 2 dates and also exclude the weekend.&lt;BR /&gt;for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from the "Produzione" table&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;programma&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Ora inizio&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Ora fine&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC-Program&lt;/TD&gt;&lt;TD&gt;21/01/2020 08:00:00&lt;/TD&gt;&lt;TD&gt;22/01/2020 09:30:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;DEF-Program&lt;/TD&gt;&lt;TD&gt;22/01/2020 10:00:00&lt;/TD&gt;&lt;TD&gt;27/01/2020 12:45:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to precisate that:&lt;/P&gt;&lt;P&gt;1. i need the difference between second and third columns&lt;/P&gt;&lt;P&gt;2. the machine can works 8h/day (9-13/14-18)&lt;/P&gt;&lt;P&gt;3. in the second row between the 2 dates there are 2 free days (saturday and sunday) and i need to exclude that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the support&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alberto&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 14:06:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524405#M29801</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-30T14:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524411#M29802</link>
      <description>&lt;P&gt;this the Pbix example:&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>Mon, 30 Nov 2020 14:08:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524411#M29802</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-30T14:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524511#M29806</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what is the &lt;STRONG&gt;expected result&lt;/STRONG&gt; in your example above?? I understand you want a calculated column in that table. If so, what values would it have in the example? So that I can be completely clear on what the&amp;nbsp;requirements are. Grazie&lt;/P&gt;
&lt;TABLE border="1" width="568px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="105.967px"&gt;&lt;STRONG&gt;programma&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="153.767px"&gt;
&lt;P&gt;&lt;STRONG&gt;Ora inizio&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="153.767px"&gt;&lt;STRONG&gt;Ora fine&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="153.7px"&gt;Expected result&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105.967px"&gt;ABC-Program&lt;/TD&gt;
&lt;TD width="153.767px"&gt;21/01/2020 08:00:00&lt;/TD&gt;
&lt;TD width="153.767px"&gt;22/01/2020 09:30:00&lt;/TD&gt;
&lt;TD width="153.7px"&gt;&lt;FONT color="#FF0000"&gt;????&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105.967px"&gt;DEF-Program&lt;/TD&gt;
&lt;TD width="153.767px"&gt;22/01/2020 10:00:00&lt;/TD&gt;
&lt;TD width="153.767px"&gt;27/01/2020 12:45:00&lt;/TD&gt;
&lt;TD width="153.7px"&gt;&lt;FONT color="#FF0000"&gt;????&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 16:02:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524511#M29806</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-11-30T16:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524592#M29808</link>
      <description>&lt;P&gt;i would like the difference betwan the column with this condition:&lt;/P&gt;&lt;P&gt;1. exclude weekend&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. consider only 8h/day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;example of row:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;program: abc&lt;/P&gt;&lt;P&gt;orainizio: 18/09/20 15:32 pm (for example Friday)&amp;nbsp;&lt;/P&gt;&lt;P&gt;orafine:&amp;nbsp; &amp;nbsp;21/09/20 09:05 am (for example Monday)&lt;/P&gt;&lt;P&gt;expected result: (1h:28min + 0h:05min) = 1h33min&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;&lt;STRONG&gt;considertion&lt;/STRONG&gt;:&amp;nbsp;&lt;/P&gt;&lt;P&gt;19/09 and 20/09 is weekend days. so i don't consider these days in the calculated colum. moreover&amp;nbsp;the machine can works 8h/day from 9 am to 5 pm so in the fist day (18/09) the total that the machine has worked is 1:28 minutes and the 21/09 the machine has started to work ad 9 am and has finished at 9:05 am (orafine) so 0h:05min and the expected result is 1h:33.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried to be clearer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alberto&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;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;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;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 30 Nov 2020 16:02:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524592#M29808</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-30T16:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524655#M29815</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks. I understand now. You need a Date table with the working days flagged (columns that flag holidays and weekends). Where is that in the model? If you don't have one, you need to build it. &lt;/P&gt;
&lt;P&gt;Why are you using all those bidirectional relationships?? They should all have one direction only (unless you have a very good reason fro the contrary and know very well what you are doing)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 16:48:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524655#M29815</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-11-30T16:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524801#M29821</link>
      <description>&lt;P&gt;ok i'll add this table in the model, but how can i calcuate the the time (ex: 1h, 2h:32min,...) and not the days between the two dates?&lt;/P&gt;&lt;P&gt;however i cannot change the data source, these are the tables that i have, do you think i could merge something?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 18:26:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524801#M29821</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-30T18:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524841#M29823</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;New Col = 
VAR date1stDay_ = DATEVALUE ( Produzione[Orainizio] )
VAR dateLastDay_ =  DATEVALUE ( Produzione[OraFine] )
VAR time1stDay_ = MAX(0, ( date1stDay_ + ( 17 / 24 ) ) - MAX ( date1stDay_ + ( 9 / 24 ), Produzione[Orainizio] ))
VAR timeLastDay_ =
    IF (
        dateLastDay_ = date1stDay_,
        0,
        MAX(0, MIN ( datelastDay_ + ( 17 / 24 ), Produzione[OraFine] ) - ( datelastDay_ + ( 9 / 24 ) ))
    )
VAR workingDaysInBetween_ =
    COUNTROWS (
        FILTER (
            ALL ( DateT ),
            DateT[Date] &amp;gt; date1stDay_ &amp;amp;&amp;amp; DateT[Date] &amp;lt; dateLastDay_ &amp;amp;&amp;amp; DateT[isWorkingDay] = TRUE ()
        )
    )
RETURN
24 * ( time1stDay_ + (workingDaysInBetween_ * ( 8 / 24 )) + timeLastDay_ )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will give you the reuslt in hours.&amp;nbsp; You can then convert it to the format you prefer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 19:00:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524841#M29823</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-11-30T19:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524891#M29825</link>
      <description>&lt;P&gt;i think this result is not right.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried to do this solution but the result isn't correct. the difference between the 2 dates is wrong.&lt;/P&gt;&lt;P&gt;i also triedto change the column format but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;and this is the table that i've created. here i can mark the days as a working days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 20:10:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524891#M29825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-30T20:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524912#M29826</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm pretty sure it works, as is or with very minor changes.&lt;/P&gt;
&lt;P&gt;The dates you show are not in the file you shared initially.&lt;/P&gt;
&lt;P&gt;It doesn't help me if you create the date table and do not share the new file with it, or if you show the code in a screen cap that cannot be copied.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please make my work easier. Otherwise I won't be able to spend any more time on this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 20:25:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1524912#M29826</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-11-30T20:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1526089#M29866</link>
      <description>&lt;P&gt;sorry for the misunderstanding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;here the most updated file. with new tabe Date and the column (result)&amp;nbsp; with the script that you have sent me before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/3bmwdvx3hjhge4h/DASHBOARD%20PRODUZIONE%20-%20Copia.pbix?dl=0" target="_blank"&gt;https://www.dropbox.com/s/3bmwdvx3hjhge4h/DASHBOARD%20PRODUZIONE%20-%20Copia.pbix?dl=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks you so much for your time.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 09:57:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1526089#M29866</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-01T09:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1526135#M29872</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alberto, you are right. It needed some modifications. You seem to have changed the machine working hours to 8-18 in the code in the file? Instead of 9-17. Why?&lt;/P&gt;
&lt;P&gt;Try this new version:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Result V2 = 
VAR date1stDay_ = DATEVALUE ( Produzione[Orainizio] )
VAR dateLastDay_ =  DATEVALUE ( Produzione[OraFine] )
VAR time1stDay_ = 
IF( dateLastDay_ &amp;lt;&amp;gt; date1stDay_,  
  MAX(0, ( date1stDay_ + ( 17 / 24 ) ) - MAX ( date1stDay_ + ( 9 / 24 ), Produzione[Orainizio] )),
  MAX(0, ( MIN(Produzione[OraFine], date1stDay_ + ( 17 / 24 ) ) - MAX ( date1stDay_ + ( 9 / 24 ), Produzione[Orainizio] )))
)
VAR timeLastDay_ = IF ( dateLastDay_ = date1stDay_,
                    0,
                    MAX(0, MIN ( datelastDay_ + ( 17 / 24 ), Produzione[OraFine] ) - ( datelastDay_ + ( 9 / 24 ) ))
                )
VAR workingDaysInBetween_ =
    COUNTROWS (
        FILTER (
            ALL ( 'Date' ),
            'Date'[Date] &amp;gt; date1stDay_ &amp;amp;&amp;amp; 'Date'[Date] &amp;lt; dateLastDay_ &amp;amp;&amp;amp; 'Date'[isWorkingDay] = TRUE ()
        )
    )
RETURN
24 * ( time1stDay_ + (workingDaysInBetween_ * ( 8 / 24 )) + timeLastDay_ )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 10:36:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1526135#M29872</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-01T10:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1526960#M29907</link>
      <description>&lt;P&gt;ok AIB, i think the file is working.&lt;/P&gt;&lt;P&gt;i changed the working hours because i saw that there are rows where "orainizio" is before 9 am and "orafine" is after 5 pm.&lt;/P&gt;&lt;P&gt;do you think that is difficult to split the working hours into 2 &lt;SPAN&gt;two shifts of work?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;example:&amp;nbsp; from 8 am to 12 pm and from 2 pm to 7 pm?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it's only a consideration... i think i should change this part of dax code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;IF( dateLastDay_ &amp;lt;&amp;gt; date1stDay_,  
  MAX(0, ( date1stDay_ + ( 17 / 24 ) ) - MAX ( date1stDay_ + ( 9 / 24 ), Produzione[Orainizio] )),
  MAX(0, ( MIN(Produzione[OraFine], date1stDay_ + ( 17 / 24 ) ) - MAX ( date1stDay_ + ( 9 / 24 ), Produzione[Orainizio] )))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;are you agree with me?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 16:27:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1526960#M29907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-01T16:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Differenza tra due date per calcolo tempo produttivo in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1526970#M29908</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Conceptually&amp;nbsp;it is not difficult; you can follow the same logic we've used&amp;nbsp; in the code above. It could be a bit tedious, though. Make sure you consider all the cases. Both these vars would need to be changed:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR time1stDay_ = 
IF( dateLastDay_ &amp;lt;&amp;gt; date1stDay_,  
  MAX(0, ( date1stDay_ + ( 17 / 24 ) ) - MAX ( date1stDay_ + ( 9 / 24 ), Produzione[Orainizio] )),
  MAX(0, ( MIN(Produzione[OraFine], date1stDay_ + ( 17 / 24 ) ) - MAX ( date1stDay_ + ( 9 / 24 ), Produzione[Orainizio] )))
)

VAR timeLastDay_ = IF ( dateLastDay_ = date1stDay_,
                    0,
                    MAX(0, MIN ( datelastDay_ + ( 17 / 24 ), Produzione[OraFine] ) - ( datelastDay_ + ( 9 / 24 ) ))
                )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 16:36:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Differenza-tra-due-date-per-calcolo-tempo-produttivo-in-Power-BI/m-p/1526970#M29908</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-01T16:36:51Z</dc:date>
    </item>
  </channel>
</rss>

