<?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: Calculating occupancy at specific times in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Calculating-occupancy-at-specific-times/m-p/2842800#M980341</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="456638" data-lia-user-login="alzhf" class="lia-mention lia-mention-user"&gt;alzhf&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;you should create one large table with one row for each interval you want to observe.&amp;nbsp;&lt;BR /&gt;Then create a calendar table and a time table separately. So make sure that your large table has date and time in different columns.&lt;BR /&gt;Your desired result table would then be a matrix with a simple count-measure in it (COUNTROWS(FactTable)).&lt;BR /&gt;If you need help building this large table, please let me know if you need anything else than 6:00 and 22:00 occupancies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 14:31:28 GMT</pubDate>
    <dc:creator>ImkeF</dc:creator>
    <dc:date>2022-10-14T14:31:28Z</dc:date>
    <item>
      <title>Calculating occupancy at specific times</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Calculating-occupancy-at-specific-times/m-p/2842073#M980135</link>
      <description>&lt;P class=""&gt;I've got a table with occupancy data and I need to calculate the occupancy at specific times. The table looks something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;in&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;out&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01.01.2020 01:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;01.01.2020 23:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01.01.2020 02:00&lt;/TD&gt;&lt;TD&gt;03.01.2020 12:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02.01.2020 07:00&lt;/TD&gt;&lt;TD&gt;02.01.2020 23:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;What I now want is a new table where I can see the occupancy at every day of the year, e.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;occ 06:00&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;occ 22:00&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01.01.2020&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02.01.2020&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03.01.2020&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class=""&gt;I most likely need a date-table for this, but I don't really know how to approach this problem in detail, so every help or idea is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 09:40:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Calculating-occupancy-at-specific-times/m-p/2842073#M980135</guid>
      <dc:creator>alzhf</dc:creator>
      <dc:date>2022-10-14T09:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating occupancy at specific times</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Calculating-occupancy-at-specific-times/m-p/2842800#M980341</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="456638" data-lia-user-login="alzhf" class="lia-mention lia-mention-user"&gt;alzhf&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;you should create one large table with one row for each interval you want to observe.&amp;nbsp;&lt;BR /&gt;Then create a calendar table and a time table separately. So make sure that your large table has date and time in different columns.&lt;BR /&gt;Your desired result table would then be a matrix with a simple count-measure in it (COUNTROWS(FactTable)).&lt;BR /&gt;If you need help building this large table, please let me know if you need anything else than 6:00 and 22:00 occupancies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 14:31:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Calculating-occupancy-at-specific-times/m-p/2842800#M980341</guid>
      <dc:creator>ImkeF</dc:creator>
      <dc:date>2022-10-14T14:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating occupancy at specific times</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Calculating-occupancy-at-specific-times/m-p/2844952#M980829</link>
      <description>&lt;P&gt;Hey Imke,&lt;/P&gt;&lt;P&gt;I solved it by using a simple COUNTROWS, just as you suggested.&amp;nbsp;&lt;BR /&gt;I created a Date Table with a custom date format and inserted a calcuated column with this code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;occupancy = COUNTROWS(
    FILTER(
        TABLE,AND(
            TABLE[IN DATE]&amp;lt;=DATETABLE[DATE],
            TABLE[OUT DATE]&amp;gt;=DATETABLE[DATE])))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works as intended.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know a way to extract the IDs for the correlating time stamps? Right now, I can only count the specific IDs/lines from the table, but I don't have access to the specific IDs.&lt;/P&gt;&lt;P&gt;Maybe by unpivoting the Date table and listing the specific IDs under the dates?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm currently trying to do this with this code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;CM eff Midnight = 
var _rangeStart= MIN('Date Slicer'[Date])
var _rangeEnd= MAX('Date Slicer'[Date])
return
CALCULATE( 
    SUMX(Table2,Table2[Value]),((Table1[DATE in]) &amp;gt;= _rangeStart),((Table1[DATE out]) &amp;lt;= _rangeEnd))&lt;/LI-CODE&gt;&lt;P&gt;but I'm not getting the correct result. Do you see my mistake here?&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 22:24:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Calculating-occupancy-at-specific-times/m-p/2844952#M980829</guid>
      <dc:creator>alzhf</dc:creator>
      <dc:date>2022-10-16T22:24:16Z</dc:date>
    </item>
  </channel>
</rss>

