<?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: Measure: if meets multiple conditions then return result of another measure. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172591#M18140</link>
    <description>&lt;P&gt;The three criteria for overtime make this one a little tricky.&amp;nbsp; Here is a proposed approached:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Make 3 variables each of which summarizes the hours per employee in the different time blocks (days, weeks, and 4 weeks); you can add a column to your Date table which groups dates into 4 week blocks&lt;/LI&gt;&lt;LI&gt;For each, calculate the SUMX, subtracting the # of non-overtime hours on each row (10, 36, and 144, respectively)&lt;/LI&gt;&lt;LI&gt;Find the max of the 3 SUMX values, multiply that by 125%&lt;/LI&gt;&lt;LI&gt;Subtract the # of overtime hours from the total hours and multiply that by 100% rate&lt;/LI&gt;&lt;LI&gt;Add the 125% and 100% values to get total (if needed)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If you provide some sample data or pbix, I can write an expression to do the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
    <pubDate>Sun, 21 Jun 2020 20:53:34 GMT</pubDate>
    <dc:creator>mahoneypat</dc:creator>
    <dc:date>2020-06-21T20:53:34Z</dc:date>
    <item>
      <title>Measure: if meets multiple conditions then return result of another measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172461#M18114</link>
      <description>&lt;DIV&gt;&lt;FONT&gt;Measure to determine whether there is overtime or not.&lt;BR /&gt;Conditions hours to considered as overtime are&lt;BR /&gt;If an employee works more than 144 hours per 4 weeks or 36 hours per week or 10 hours per day,&amp;nbsp; hours worked in excess of contract hours must be paid as overtime (125%) otherwise as 100%.&lt;BR /&gt;I have a table per employee where contract hours per period / week / day are defined and a measure to calculate the deviation contract hours &amp;amp; hours worked per day.&lt;/FONT&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Deviation contract Hours = [Nett Time]-[ContractHours]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Deviation contract Hours to add up = if(countrows(values(DCalendar[Date]))=1,[&lt;FONT&gt;Deviation contract Hours&lt;/FONT&gt;],sumx(values(DCalendar[Date]),[&lt;FONT&gt;Deviation contract Hours&lt;/FONT&gt;]))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Many thanks in advance for your support&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 16:26:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172461#M18114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-21T16:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: if meets multiple conditions then return result of another measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172490#M18119</link>
      <description>&lt;P&gt;This looks like a good start. Where are you stuck?&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 17:24:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172490#M18119</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-21T17:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: if meets multiple conditions then return result of another measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172561#M18137</link>
      <description>&lt;P&gt;Hi Ibendlin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your feedback.&lt;/P&gt;&lt;P&gt;The measure "Deviation contract Hours to add up" is working correctly but this measure just gives me the diff between contract hours and hours worked. &lt;FONT&gt;To determine whether the overtime should be paid as 100% or 125% I need to include the conditions If an employee works more than 144 hours per 4 weeks OR 36 hours per week OR 10 hours per day. If these conditions are met, the hours must be considered as 125% otherwise as 100%.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you - Natasja&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 19:37:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172561#M18137</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-21T19:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: if meets multiple conditions then return result of another measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172590#M18139</link>
      <description>&lt;P&gt;Dear Ibendlin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I meantime figured out how to include a filter to determine whether an employee has a Fulltime or Parttime contract. Pls refer to measure Overtime (125%).&lt;/P&gt;&lt;P&gt;The last condition to determine whether the deviation contract hours should be paid as 100% or 125% is to check whether an employee worked 10 or more hours (=measure Nett Time) that particular day. My thought was to add an OR if Nett Time &amp;gt;=10 to the measure Overtime (125%), but I don’t know how to include this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Deviation contract Hours = [Nett Time]-[ContractHours]&lt;/P&gt;&lt;P&gt;Overtime (125%) = Calculate([Nett Time],filter('ContractHours 1','ContractHours 1'[Weekday]=8 &amp;amp;&amp;amp; ' ContractHours&lt;SPAN&gt; 1'[Value]&amp;gt;=36))-&lt;/SPAN&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;([ContractHours],&lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;(' ContractHours 1',' ContractHours 1'[Weekday]=8 &amp;amp;&amp;amp; ' ContractHours 1'[Value]&amp;gt;=36))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again many thanks for your support, much appreciated !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Natasja&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 20:53:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172590#M18139</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-21T20:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: if meets multiple conditions then return result of another measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172591#M18140</link>
      <description>&lt;P&gt;The three criteria for overtime make this one a little tricky.&amp;nbsp; Here is a proposed approached:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Make 3 variables each of which summarizes the hours per employee in the different time blocks (days, weeks, and 4 weeks); you can add a column to your Date table which groups dates into 4 week blocks&lt;/LI&gt;&lt;LI&gt;For each, calculate the SUMX, subtracting the # of non-overtime hours on each row (10, 36, and 144, respectively)&lt;/LI&gt;&lt;LI&gt;Find the max of the 3 SUMX values, multiply that by 125%&lt;/LI&gt;&lt;LI&gt;Subtract the # of overtime hours from the total hours and multiply that by 100% rate&lt;/LI&gt;&lt;LI&gt;Add the 125% and 100% values to get total (if needed)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If you provide some sample data or pbix, I can write an expression to do the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 20:53:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-if-meets-multiple-conditions-then-return-result-of/m-p/1172591#M18140</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-06-21T20:53:34Z</dc:date>
    </item>
  </channel>
</rss>

