<?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 measure to calculate percentage of capacity hours utilization based on available hours in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-percentage-of-capacity-hours/m-p/2739786#M84153</link>
    <description>&lt;P&gt;Hi&amp;nbsp; Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
var _select=SELECTEDVALUE('NZ_Factory_Calendar'[12. Week/Year])
return
DIVIDE(
ABS(
SUMX(FILTER(ALL(WorkCentre220), 'WorkCentre220'[7. Week/Year]=_select),[3. Required Hours])
-
SUMX(FILTER(ALL('NZ_Factory_Calendar'),'NZ_Factory_Calendar'[12. Week/Year]=_select),[9. Available Capacity])),
SUMX(FILTER(ALL('NZ_Factory_Calendar'),'NZ_Factory_Calendar'[12. Week/Year]=_select),[9. Available Capacity]))&lt;/LI-CODE&gt;
&lt;P&gt;2. Check Meausre – Measure tools -- %.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you need pbix, please click here.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://m365x97431909-my.sharepoint.com/:u:/g/personal/ly_m365x97431909_onmicrosoft_com/EdQwHBcq4MNJj-yqtS-vsY4B95H2Su0oYQRU7bmHIX0Ijg?e=QImLOo" target="_blank"&gt;&lt;SPAN&gt;Work Centre 220 Production Planning Hours.pbix&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2022 06:32:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-01T06:32:45Z</dc:date>
    <item>
      <title>DAX measure to calculate percentage of capacity hours utilization based on available hours</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-percentage-of-capacity-hours/m-p/2731445#M83658</link>
      <description>&lt;P&gt;Hello wonderful community, I will try my best to articulate my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an Excel workbook that stores 2 tables, WorkCentre220 and NZ_Factory_Calendar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WorkCentre220 Table contains:&lt;/P&gt;&lt;P&gt;1. Date of production order scheduled (Column - 1. Date)&lt;/P&gt;&lt;P&gt;2. Pegged Requirements Quantity in Each units of materials utilized (Column - 2. Pegged Requirement Quantity)&lt;/P&gt;&lt;P&gt;3. Required Hours to complete production order (Column - 3. Required Hours)&lt;/P&gt;&lt;P&gt;4. The Setup Group that the Production Order is assigned to (Column - 4. Setup Group Category)&lt;/P&gt;&lt;P&gt;5. Week Number ( Formula is&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;WEEKNUM&lt;/SPAN&gt;&lt;SPAN&gt;(WorkCentre220[1. Date],&lt;/SPAN&gt;&lt;SPAN&gt;21&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;) &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Calculated Column&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;6. Year (Formula is&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;WorkCentre220&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;[1. Date]&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Calculated Column&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;7. Week/Year (Formula is&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;SPAN&gt;"Week "&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;WorkCentre220&lt;/SPAN&gt;&lt;SPAN&gt;[5. Week Number]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;"/52 in "&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;WorkCentre220&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;[6. Year]&lt;/STRONG&gt;&lt;/FONT&gt; ) &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Calculated Column&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NZ_Factory_Calendar tables contains information on &lt;STRONG&gt;Available Number of Machines/day (defaulted at 3/day, value depends on real world situation but lets assume there will be no machine breakdowns until 2030)&lt;/STRONG&gt;, &lt;STRONG&gt;Number of Production Shifts/day (always 2 shifts/day)&lt;/STRONG&gt;, &lt;STRONG&gt;% of Hours Utilization (always at 97%)&lt;/STRONG&gt; and &lt;STRONG&gt;Available Hours/Shift (always at 7.5 hours/day)&lt;/STRONG&gt;&amp;nbsp;from dates between 1st Jan 2022 to 31st Dec 2030. &lt;STRONG&gt;Week/Year&lt;/STRONG&gt; column is also available in this table just like table WorkCentre220. NZ_Factory_Calendar also has indication of Work or Holiday which takes into account weekends and public holidays in NZ, I have built in the logic in Excel to return 0 hours in &lt;STRONG&gt;Total Available Production Capacity&lt;/STRONG&gt; when it is a Holiday date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is one calculated column called "9. Available Capacity" that calculates the Available Capacity per date (per row, as Dates in NZ_Factory_Calendar is primary unique key data) which equals to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Total Available Production Capacity&lt;/STRONG&gt; = &lt;STRONG&gt;Number of Machines/day&lt;/STRONG&gt; * &lt;STRONG&gt;Number of Production Shifts/day&lt;/STRONG&gt; * &lt;STRONG&gt;% of Hours Utilization (97%)&lt;/STRONG&gt; * &lt;STRONG&gt;Available Hours/Shift (7.5 hours) = 43.65 production hours available per day (take this as a guide for daily hours)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to be able to create a DAX measure that calculates and indicates underloading or overloading of production planning hours against the Hours Available in Weekly timeframe. Something along the line of:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Production Hours Utilization = ( ABS( 'WorkCentre220'[Required Hours] - 'NZ_Factory_Calendar'[Available Capacity] ) /&amp;nbsp;&lt;SPAN&gt;'NZ_Factory_Calendar'[Available Capacity] ) * 100%&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;However this Measure includes 2 columns from different tables and I can't quite figure out how to do this in a resilient way. There will be weeks that my production planning team overloaded the production order and there will be weeks that it will be underloaded. Underloading is fine but we want to be able to capture overloading so that we can shift forward the hours to balance it out. I will receive of weekly extration of this file in Excel format so the production planning hours will be updated in a weekly basis (don't worry about data refresh). I want to be able to have some indication like overloading percentage in RED and underloading in GREEN using a visual that would be of a best practice or a recommended standard. See snapshot below:&lt;/SPAN&gt;&lt;/SPAN&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;&lt;SPAN&gt;&lt;SPAN&gt;I'm quite a beginner in Power BI and DAX so please if anyone can help me, it'll be very much appreciated.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Let me know if you need further clarification. I have included a link that contains the Excel Workbook as the data source as well as the Power BI .pbix file below:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;A href="https://1drv.ms/x/s!ApO53FDyjUUO9gKgoAKws3mfm-PS?e=1xCkWk" target="_blank"&gt;https://1drv.ms/x/s!ApO53FDyjUUO9gKgoAKws3mfm-PS?e=1xCkWk&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!ApO53FDyjUUO9gNfxEkuo-bhJgUN?e=wA4N4X" target="_blank"&gt;https://1drv.ms/u/s!ApO53FDyjUUO9gNfxEkuo-bhJgUN?e=wA4N4X&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 05:03:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-percentage-of-capacity-hours/m-p/2731445#M83658</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-29T05:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure to calculate percentage of capacity hours utilization based on available hours</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-percentage-of-capacity-hours/m-p/2739786#M84153</link>
      <description>&lt;P&gt;Hi&amp;nbsp; Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
var _select=SELECTEDVALUE('NZ_Factory_Calendar'[12. Week/Year])
return
DIVIDE(
ABS(
SUMX(FILTER(ALL(WorkCentre220), 'WorkCentre220'[7. Week/Year]=_select),[3. Required Hours])
-
SUMX(FILTER(ALL('NZ_Factory_Calendar'),'NZ_Factory_Calendar'[12. Week/Year]=_select),[9. Available Capacity])),
SUMX(FILTER(ALL('NZ_Factory_Calendar'),'NZ_Factory_Calendar'[12. Week/Year]=_select),[9. Available Capacity]))&lt;/LI-CODE&gt;
&lt;P&gt;2. Check Meausre – Measure tools -- %.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you need pbix, please click here.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://m365x97431909-my.sharepoint.com/:u:/g/personal/ly_m365x97431909_onmicrosoft_com/EdQwHBcq4MNJj-yqtS-vsY4B95H2Su0oYQRU7bmHIX0Ijg?e=QImLOo" target="_blank"&gt;&lt;SPAN&gt;Work Centre 220 Production Planning Hours.pbix&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 06:32:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-calculate-percentage-of-capacity-hours/m-p/2739786#M84153</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-01T06:32:45Z</dc:date>
    </item>
  </channel>
</rss>

