<?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 Calculate with a start and finish time, how many employees are working at a certain time. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856778#M91849</link>
    <description>&lt;P&gt;I want to be able to measure how many FTEs (employees) are working at the times from the table "Table_Time_Interval".&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The FTEs (employees) who are working are recorded in the table "Table_Roster". Where column "Time Type" must have the value "worktime".&lt;BR /&gt;And with the columns Start and Finish you should be able to calculate whether they are active at the times from the table "Table_Time_Interval".&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The following must be taken into account: In the example you can see that James has a "Time Type" with the value "non availability" from 8.00 to 9.00.&lt;BR /&gt;As a result, the time hour 8.00 should not be returned, even though it has a "Time Type" with the value "worktime" from 8.00 to 17.00&lt;BR /&gt;&lt;BR /&gt;&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;&lt;P&gt;&lt;BR /&gt;The code of the two fact tables:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Table_Roster&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Bron = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMTS1W0lEqzy/KLsnMTQUyQ1ITcxWCUlOATCNDXUMDXSMjBNPAyEjBwMLKwABVyNAcJBSrgzAwNzW1JDMvnUzzDCzh5uVn5FHVfRDzSHCeoQGmcYYw44Izc/NJdZ+hEYaBRhgG5pTmJWckFaUmZhNnpimmI81gZroVgXWiu9EppzSVvECEGogWiKSaB43kWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, #"Time Type" = _t, #"Team Name" = _t, Date = _t, Start = _t, Finish = _t]),&lt;BR /&gt;#"Type gewijzigd" = Table.TransformColumnTypes(Bron,{{"Name", type text}, {"Time Type", type text}, {"Team Name", type text}, {"Date", type date}, {"Start", type datetime}, {"Finish", type datetime}})&lt;BR /&gt;in&lt;BR /&gt;#"Type gewijzigd"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Table_Time_Interval&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;let&lt;BR /&gt;Bron = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("hdE7CoAwFETRrYTUCeSNf5chdpJC0NL9t4ppZMBMlzzmVHfb/Hrul1vOwwcPi5Yi8DzHOaXPxb3/HP7mE82n+twS7cuhAoyBCQAGEKBh0AjQMmgF6Bh0AvQMegEGBoMAnNlEZ+PQJkqDS0OUBpeGKA0uXQ453w==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Team Name" = _t, Date = _t, Time = _t, Interval = _t]),&lt;BR /&gt;#"Type gewijzigd" = Table.TransformColumnTypes(Bron,{{"Team Name", type text}, {"Date", type date}, {"Time", type time}, {"Interval", type datetime}})&lt;BR /&gt;in&lt;BR /&gt;#"Type gewijzigd"&lt;/P&gt;</description>
    <pubDate>Sat, 22 Oct 2022 10:42:15 GMT</pubDate>
    <dc:creator>brief001</dc:creator>
    <dc:date>2022-10-22T10:42:15Z</dc:date>
    <item>
      <title>Calculate with a start and finish time, how many employees are working at a certain time.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856778#M91849</link>
      <description>&lt;P&gt;I want to be able to measure how many FTEs (employees) are working at the times from the table "Table_Time_Interval".&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The FTEs (employees) who are working are recorded in the table "Table_Roster". Where column "Time Type" must have the value "worktime".&lt;BR /&gt;And with the columns Start and Finish you should be able to calculate whether they are active at the times from the table "Table_Time_Interval".&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The following must be taken into account: In the example you can see that James has a "Time Type" with the value "non availability" from 8.00 to 9.00.&lt;BR /&gt;As a result, the time hour 8.00 should not be returned, even though it has a "Time Type" with the value "worktime" from 8.00 to 17.00&lt;BR /&gt;&lt;BR /&gt;&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;&lt;P&gt;&lt;BR /&gt;The code of the two fact tables:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Table_Roster&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Bron = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMTS1W0lEqzy/KLsnMTQUyQ1ITcxWCUlOATCNDXUMDXSMjBNPAyEjBwMLKwABVyNAcJBSrgzAwNzW1JDMvnUzzDCzh5uVn5FHVfRDzSHCeoQGmcYYw44Izc/NJdZ+hEYaBRhgG5pTmJWckFaUmZhNnpimmI81gZroVgXWiu9EppzSVvECEGogWiKSaB43kWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, #"Time Type" = _t, #"Team Name" = _t, Date = _t, Start = _t, Finish = _t]),&lt;BR /&gt;#"Type gewijzigd" = Table.TransformColumnTypes(Bron,{{"Name", type text}, {"Time Type", type text}, {"Team Name", type text}, {"Date", type date}, {"Start", type datetime}, {"Finish", type datetime}})&lt;BR /&gt;in&lt;BR /&gt;#"Type gewijzigd"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Table_Time_Interval&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;let&lt;BR /&gt;Bron = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("hdE7CoAwFETRrYTUCeSNf5chdpJC0NL9t4ppZMBMlzzmVHfb/Hrul1vOwwcPi5Yi8DzHOaXPxb3/HP7mE82n+twS7cuhAoyBCQAGEKBh0AjQMmgF6Bh0AvQMegEGBoMAnNlEZ+PQJkqDS0OUBpeGKA0uXQ453w==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Team Name" = _t, Date = _t, Time = _t, Interval = _t]),&lt;BR /&gt;#"Type gewijzigd" = Table.TransformColumnTypes(Bron,{{"Team Name", type text}, {"Date", type date}, {"Time", type time}, {"Interval", type datetime}})&lt;BR /&gt;in&lt;BR /&gt;#"Type gewijzigd"&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 10:42:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856778#M91849</guid>
      <dc:creator>brief001</dc:creator>
      <dc:date>2022-10-22T10:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with a start and finish time, how many employees are working at a certain time.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856781#M91850</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 10:43:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856781#M91850</guid>
      <dc:creator>brief001</dc:creator>
      <dc:date>2022-10-22T10:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with a start and finish time, how many employees are working at a certain time.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856879#M91856</link>
      <description>&lt;P&gt;hello its tricky for me but i can share what i got till now:&lt;BR /&gt;first go to tranform data and then to your roster table&lt;BR /&gt;add the following :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Start Hour = Time.Hour([Start])

End Hour = Time.Hour([Finish])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;then add list of those hours:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;List = {Number.From([Start Hour])..Number.From([End Hour])}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then expand to new rows&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you will get a list of their hours&amp;nbsp;&lt;BR /&gt;now go to interval and add the hours column same as above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Hours = Time.Hour([Interval])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after that make sure both are whole number type&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;then create an inactive relationship between both added column hours and make this measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;availibilty = CALCULATE(COUNT(Roster[Team Name]),FILTER(Roster,Roster[Time Type] = "worktime"),USERELATIONSHIP(Time_Interval[Custom],Roster[Hours]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;as you see it counts perfectly&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;but you have work time overlaping with meetings or breaks so add new measure :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;not availibilty = CALCULATE(COUNT(Roster[Team Name]),FILTER(Roster,Roster[Time Type] &amp;lt;&amp;gt; "worktime"),USERELATIONSHIP(Time_Interval[Custom],Roster[Hours]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and now just create final measure :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total = [Available]-[Not Available]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;my only problem is that it is taking for example break from 8 to 9 as 8 and 9 not available instead of only at 8 not available&lt;BR /&gt;i hope i couldve helped you reach one step closer to your goal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 13:04:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856879#M91856</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-22T13:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with a start and finish time, how many employees are working at a certain time.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856926#M91858</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;eliasayy,&amp;nbsp;thanks so far.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I'm stuck on your action to 'add list of those hours'. Otherwise can you give me the code of the advanced editor in Power Query Editor?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 13:54:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856926#M91858</guid>
      <dc:creator>brief001</dc:creator>
      <dc:date>2022-10-22T13:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with a start and finish time, how many employees are working at a certain time.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856940#M91861</link>
      <description>&lt;P&gt;Hello im sorey i dont have my computer on me, but i can help you through it. In the table roster, write the codes i gave to you to give the hour of start and finish dates.afyer that, Make sure the type is whole number. Then add another column and write the code i gave you to make a list. The lost should be between the columns i instructed you to add then expand to new rows&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 14:43:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856940#M91861</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-22T14:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with a start and finish time, how many employees are working at a certain time.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856948#M91863</link>
      <description>&lt;P&gt;I thought I could count the numbers of "worktime" myself with the formula below, but I'm stuck on the value of date-time. Does anyone have a suggestion how I can still filter on the start date-time and finish date-time?&lt;BR /&gt;&lt;BR /&gt;If I can create a counter on "worktime", then I can copy it for "non availability". And by subtracting these from each other I get the correct result.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 14:51:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856948#M91863</guid>
      <dc:creator>brief001</dc:creator>
      <dc:date>2022-10-22T14:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with a start and finish time, how many employees are working at a certain time.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856957#M91864</link>
      <description>&lt;P&gt;I have now succeeded with your additional supplement. And now I see that it's just not exactly what I'm looking for. The problem is in the end time, he also counts this. Perhaps I can solve it by counting down one minute at the end time.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 15:04:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2856957#M91864</guid>
      <dc:creator>brief001</dc:creator>
      <dc:date>2022-10-22T15:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with a start and finish time, how many employees are working at a certain time.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2857354#M91891</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284859" data-lia-user-login="brief001" class="lia-mention lia-mention-user"&gt;brief001&lt;/a&gt;&amp;nbsp;i finally found the solution&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i will share with you the powerbi i used inorder for you to see the steps in details.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;but i will still share how i did it,&lt;BR /&gt;after created the extra columns from power query and expnding the list of hours,&lt;BR /&gt;go back to dax,&lt;BR /&gt;on the roster table,&lt;BR /&gt;add a new calculated column and filter to only show the max value of non worktime:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Maxnonworking = CALCULATE(MAX(Roster[Hours]),FILTER(ALLEXCEPT(Roster,Roster[Name]),Roster[Time Type]&amp;lt;&amp;gt;"worktime"))&lt;/LI-CODE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;after you created the calculated column&amp;nbsp;&lt;BR /&gt;create a new measure for the not available people :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;not availibilty = CALCULATE(COUNT(Roster[Team Name]),FILTER(Roster,Roster[Time Type] &amp;lt;&amp;gt; "worktime"),FILTER(Roster,Roster[Hours]&amp;lt;&amp;gt;Roster[Maxnonworking]),USERELATIONSHIP(Time_Interval[Custom],Roster[Hours]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after that you got your total of available - non available people and you get your result&lt;BR /&gt;never the less here are the links to the powerbi and excel file:&lt;BR /&gt;pbix : &lt;A href="https://1drv.ms/u/s!Ag9tIyk2ofNRjlYLQU7dP7ifIDv7?e=Fa0iar" target="_blank"&gt;https://1drv.ms/u/s!Ag9tIyk2ofNRjlYLQU7dP7ifIDv7?e=Fa0iar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;excel :&amp;nbsp;&lt;A href="https://1drv.ms/x/s!Ag9tIyk2ofNRjleKjjoq0mcHbvM8?e=JcDgoE" target="_blank"&gt;https://1drv.ms/x/s!Ag9tIyk2ofNRjleKjjoq0mcHbvM8?e=JcDgoE&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2022 09:57:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2857354#M91891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-23T09:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with a start and finish time, how many employees are working at a certain time.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2858833#M91977</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;What an effort you put in to answer my question. I think this is really very nice of you. And so nice that you also explain in great detail how you came to the solution. A thousand thanks for this!&lt;BR /&gt;&lt;BR /&gt;Besides the fact that your solution works great, I find it annoying that my table Roster is getting very large in terms of records.&lt;BR /&gt;&lt;BR /&gt;-- --&lt;BR /&gt;&lt;BR /&gt;I came up with the DAX formula below myself. However, this goes wrong as soon as I get data from, for example, October 22 in both fact tables. Then my DAX formula only works if I add filter visualization in my dashboard where I always have to select a day. Selecting this is not what I want. Because my goal is that he would then return a summation of the dates.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Count Worktime = &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; Interval = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(Table_Time_Interval[Interval])&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; NewTable =&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;CALCULATETABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;GROUPBY&lt;/SPAN&gt;&lt;SPAN&gt;(Table_Roster,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Table_Roster[Team Name],Table_Roster[Name],Table_Roster[Time Type]),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(Table_Roster, Table_Roster[Time Type] = &lt;/SPAN&gt;&lt;SPAN&gt;"worktime"&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(Table_Roster, Table_Roster[Start] &amp;nbsp; &amp;lt;= Interval &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(Table_Roster, Table_Roster[Finish] &amp;nbsp; &amp;gt; Interval &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; Result =&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt; ( NewTable &amp;nbsp;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Result&lt;BR /&gt;&lt;BR /&gt;----------------------------&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Count Non Worktime = &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;Interval&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table_Time_Interval&lt;/SPAN&gt;&lt;SPAN&gt;[Interval]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;NewTable&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;CALCULATETABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;GROUPBY&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table_Roster&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;Table_Roster&lt;/SPAN&gt;&lt;SPAN&gt;[Team Name]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Table_Roster&lt;/SPAN&gt;&lt;SPAN&gt;[Name]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Table_Roster&lt;/SPAN&gt;&lt;SPAN&gt;[Time Type]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table_Roster&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Table_Roster&lt;/SPAN&gt;&lt;SPAN&gt;[Time Type]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;"worktime"&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table_Roster&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Table_Roster&lt;/SPAN&gt;&lt;SPAN&gt;[Start]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;Interval&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table_Roster&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Table_Roster&lt;/SPAN&gt;&lt;SPAN&gt;[Finish]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;Interval&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;Result&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;NewTable&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Result&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;----------------------------&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Total = &lt;/SPAN&gt;&lt;SPAN&gt;[Count Worktime]&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;[Count Non Worktime]&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#0000FF"&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Oct 2022 10:04:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2858833#M91977</guid>
      <dc:creator>brief001</dc:creator>
      <dc:date>2022-10-24T10:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with a start and finish time, how many employees are working at a certain time.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2858844#M91978</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/381685" target="_blank" rel="noopener"&gt;@eliasayy&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Can you perhaps think of a solution how my DAX formula could work, without having to select or filter a specific day in my Dashboard?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;A href="https://we.tl/t-C4obpZpxSf" target="_blank"&gt;https://we.tl/t-C4obpZpxSf&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Greetings, Bas.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 10:12:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-with-a-start-and-finish-time-how-many-employees-are/m-p/2858844#M91978</guid>
      <dc:creator>brief001</dc:creator>
      <dc:date>2022-10-24T10:12:21Z</dc:date>
    </item>
  </channel>
</rss>

