<?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: DAX to Calculate Room Utilization by Hour and Day in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Calculate-Room-Utilization-by-Hour-and-Day/m-p/2015589#M44836</link>
    <description>&lt;P&gt;Thanks for the reply&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;. I changed var _occupied per your recommendation. After charting Source[Date] and Table Time[Time], I'm getting zeros. Any help would be greatly appreciated! Thanks again!&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;</description>
    <pubDate>Fri, 13 Aug 2021 14:47:33 GMT</pubDate>
    <dc:creator>seanguerrero</dc:creator>
    <dc:date>2021-08-13T14:47:33Z</dc:date>
    <item>
      <title>DAX to Calculate Room Utilization by Hour and Day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Calculate-Room-Utilization-by-Hour-and-Day/m-p/2013712#M44773</link>
      <description>&lt;P&gt;Hi PBI Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to calculate hourly % utilization with a sample of the following data points. I want to display a matrix visual that shows by day and hour, the percentage of rooms occupied (similar to the last image). I found this DAX on this site but couldn't get it to calculate correctly. I also need to ensure that the appropriate utilization is calculated for the hours inbetween "In" and "Out." For instance, if 'In' is 8am and 'Out' is 10am, I need to make sure that the DAX accounts for the 9am hour.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry -- new to DAX and looking to learn from the community.&lt;/P&gt;&lt;P&gt;_______________________&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure Utilization =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var _occupied =&lt;BR /&gt;CALCULATE(COUNT('Source'[Guest]),&lt;BR /&gt;FILTER(ALLSELECTED('Source'),&lt;BR /&gt;'Source'[In]&amp;lt;=MAX('Table Time'[Time])&amp;amp;&amp;amp;'Source'[Out]&amp;gt;=MAX('Table Time'[Time])&amp;amp;&amp;amp;'Source'[Date]=MAX('Table Calendar'[Date])))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var _utilization =&lt;/P&gt;&lt;P&gt;DIVIDE(_occupied,20) // for 20 rooms&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;return&lt;BR /&gt;IF(_utilization = BLANK(),0,_utilization)&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;&lt;img /&gt;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 18:13:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Calculate-Room-Utilization-by-Hour-and-Day/m-p/2013712#M44773</guid>
      <dc:creator>seanguerrero</dc:creator>
      <dc:date>2021-08-12T18:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Calculate Room Utilization by Hour and Day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Calculate-Room-Utilization-by-Hour-and-Day/m-p/2014294#M44798</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="319574" data-lia-user-login="seanguerrero" class="lia-mention lia-mention-user"&gt;seanguerrero&lt;/a&gt; , change var _occupied&amp;nbsp; like this and try &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;var _occupied =&lt;BR /&gt;Sumx( addcolumns( summarize( 'Source', 'Source'[Guest], source[Date] ) , "_1", calculate(COUNT('Source'[Guest]),&lt;BR /&gt;FILTER(ALLSELECTED('Source'),&lt;BR /&gt;'Source'[In]&amp;lt;=MAX('Table Time'[Time])&amp;amp;&amp;amp;'Source'[Out]&amp;gt;=MAX('Table Time'[Time])&amp;amp;&amp;amp;'Source'[Date]=MAX('Table Calendar'[Date])))), [_1])&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 03:38:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Calculate-Room-Utilization-by-Hour-and-Day/m-p/2014294#M44798</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-08-13T03:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Calculate Room Utilization by Hour and Day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Calculate-Room-Utilization-by-Hour-and-Day/m-p/2015589#M44836</link>
      <description>&lt;P&gt;Thanks for the reply&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;. I changed var _occupied per your recommendation. After charting Source[Date] and Table Time[Time], I'm getting zeros. Any help would be greatly appreciated! Thanks again!&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;</description>
      <pubDate>Fri, 13 Aug 2021 14:47:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Calculate-Room-Utilization-by-Hour-and-Day/m-p/2015589#M44836</guid>
      <dc:creator>seanguerrero</dc:creator>
      <dc:date>2021-08-13T14:47:33Z</dc:date>
    </item>
  </channel>
</rss>

