<?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: calculate % based on multiple criteria in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3665154#M142068</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="681212" data-lia-user-login="bree_carter" class="lia-mention lia-mention-user"&gt;bree_carter&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Please try this:&lt;/P&gt;
&lt;P&gt;With your data, I create a calcualte column:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Calculated Shift = 
VAR _sumHours = CALCULATE(
                    SUM('Table'[Hours]),
                    FILTER('Table',
                        'Table'[Date]=EARLIER('Table'[Date])
                        &amp;amp;&amp;amp;
                        'Table'[Employee Id]=EARLIER('Table'[Employee Id])
                        )
                    )
//Get the sum of the Hours separately
RETURN 'Table'[Hours]/_sumHours&lt;/LI-CODE&gt;
&lt;P&gt;Select the Column(Calculated Shift) &amp;gt; &lt;U&gt;&lt;STRONG&gt;Column tools&lt;/STRONG&gt;&lt;/U&gt; &amp;gt; Change the &lt;U&gt;&lt;STRONG&gt;Display the values in this column with commas as a thousand separator&lt;/STRONG&gt;&lt;/U&gt; to 2&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is as follow:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jan 2024 02:11:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-01-29T02:11:44Z</dc:date>
    <item>
      <title>calculate % based on multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3663652#M141985</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have data which shows shift hours, but I need to convert that to a shift quantity (or percentage of the shift on that day for that person). The issue I have is when there are 2 shift types on one day (ie: they might attend work and then leave part way through), so I need to show 0.# worked and 0.# unplanned leave.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Columns A-D are what comes from a report.&lt;/P&gt;&lt;P&gt;Columns E &amp;amp; F are how I would do it in excel. If anyone can tell me how to do it in Power BI it would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&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;</description>
      <pubDate>Sat, 27 Jan 2024 02:03:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3663652#M141985</guid>
      <dc:creator>bree_carter</dc:creator>
      <dc:date>2024-01-27T02:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: calculate % based on multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3664161#M142018</link>
      <description>&lt;P&gt;We want to help you but your description is too vaugue. Please write it again clearly.&lt;/P&gt;&lt;P&gt;We are Power BI expets but we dont know what you want your reports to do.&lt;/P&gt;&lt;P&gt;Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.&lt;/P&gt;&lt;P&gt;Remove any unneeded columns which may cause confussion.&lt;/P&gt;&lt;P&gt;Rename columns to user friendly names.&lt;BR /&gt;Also provide the example desired output, with a clear description of the process flow.&lt;/P&gt;&lt;P&gt;Show step-by-step calulations.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.&lt;BR /&gt;Try keep it simple and ask one question per ticket.&lt;BR /&gt;You will get a quick response if you put time, care and effort into writing clear problem descriptions.&lt;BR /&gt;Remember you are gerrting free expert help, so please put lots of proper effort to asking questions and providing example.&lt;/P&gt;&lt;P&gt;Vaugue descriptions can waste your time and ourtime.&lt;/P&gt;&lt;P&gt;Look foward to helping you when the above information is forthcoming&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2024 14:27:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3664161#M142018</guid>
      <dc:creator>speedramps</dc:creator>
      <dc:date>2024-01-27T14:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: calculate % based on multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3664594#M142036</link>
      <description>&lt;P&gt;Thanks and apologies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a payroll extract that shows hours per person per day. A person may have more than one type of entry for a day (shown in the yellow highlight above). IE: in one day, a person may have some worked hours and some paid leave hours.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to convert this information:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;CURRENTLY:&amp;nbsp; &lt;STRONG&gt;hours,&lt;/STRONG&gt; per person, per day, per worked shift or leave type&lt;/LI&gt;&lt;LI&gt;REQUIRE: &lt;STRONG&gt;calculated shift (Decimal format (to 2 decimal places))&lt;/STRONG&gt;,&amp;nbsp;per person, per day, per worked shift or leave type&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to obtain is in column E in the above image&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;An example would be: on 01/01/24, EMP001 worked 0.7 of a shift and had 0.3 of a shift as LWOP -Planned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The headings are as per the report that comes out of the system.&lt;/P&gt;&lt;P&gt;Data is below. Thanks for your time. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Employee Id&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Hours&lt;/TD&gt;&lt;TD&gt;Time Off Name&lt;/TD&gt;&lt;TD&gt;Calculated Shift&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EMP001&lt;/TD&gt;&lt;TD&gt;1/01/2024&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;Worked Shift&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EMP001&lt;/TD&gt;&lt;TD&gt;1/01/2024&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;LWOP - Planned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EMP001&lt;/TD&gt;&lt;T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t;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EMP002&lt;/TD&gt;&lt;TD&gt;2/01/2024&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;Worked Shift&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EMP002&lt;/TD&gt;&lt;TD&gt;3/01/2024&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;Planned Annual Leave&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EMP002&lt;/TD&gt;&lt;TD&gt;4/01/2024&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;Worked Shift&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EMP002&lt;/TD&gt;&lt;TD&gt;5/01/2024&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;Personal Leave - Unplanned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EMP002&lt;/TD&gt;&lt;TD&gt;6/01/2024&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;Worked Shift&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EMP002&lt;/TD&gt;&lt;TD&gt;6/01/2024&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;LWOP - Unplanned&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sun, 28 Jan 2024 06:09:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3664594#M142036</guid>
      <dc:creator>bree_carter</dc:creator>
      <dc:date>2024-01-28T06:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: calculate % based on multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3664985#M142057</link>
      <description>&lt;P&gt;We want to help you but your description is too vaugue. Please write it again clearly.&lt;/P&gt;&lt;P&gt;We are Power BI expets but we dont know your jargon like LWOP or what you want your reports to do!&lt;/P&gt;&lt;P&gt;Please ask a colleagueto manager to read your question, and help you write it for an external reader.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why&lt;SPAN&gt;&amp;nbsp;does 01/01/24, EMP001 = 0.7and&amp;nbsp; 0.3&amp;nbsp;???&lt;/SPAN&gt;&lt;BR /&gt;Provide a clear step-by-step description of the process flow.&lt;/P&gt;&lt;P&gt;Show step-by-step calulations.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you. T&lt;/P&gt;&lt;P&gt;Try include all the details in one post, so we dont have to scrool up and down to try fathom wahat you want.&lt;BR /&gt;Try keep it concise and simple and ask one question per ticket.&lt;BR /&gt;You will get a quick response if you put time, care and effort into writing clear problem descriptions.&lt;BR /&gt;Remember you are gerrting free expert help, so please put lots of proper effort to asking questions and providing example.&lt;/P&gt;&lt;P&gt;Vaugue descriptions can waste your time and ourtime.&lt;/P&gt;&lt;P&gt;Look foward to helping you when the above information is forthcoming&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jan 2024 20:49:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3664985#M142057</guid>
      <dc:creator>speedramps</dc:creator>
      <dc:date>2024-01-28T20:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: calculate % based on multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3665154#M142068</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="681212" data-lia-user-login="bree_carter" class="lia-mention lia-mention-user"&gt;bree_carter&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Please try this:&lt;/P&gt;
&lt;P&gt;With your data, I create a calcualte column:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Calculated Shift = 
VAR _sumHours = CALCULATE(
                    SUM('Table'[Hours]),
                    FILTER('Table',
                        'Table'[Date]=EARLIER('Table'[Date])
                        &amp;amp;&amp;amp;
                        'Table'[Employee Id]=EARLIER('Table'[Employee Id])
                        )
                    )
//Get the sum of the Hours separately
RETURN 'Table'[Hours]/_sumHours&lt;/LI-CODE&gt;
&lt;P&gt;Select the Column(Calculated Shift) &amp;gt; &lt;U&gt;&lt;STRONG&gt;Column tools&lt;/STRONG&gt;&lt;/U&gt; &amp;gt; Change the &lt;U&gt;&lt;STRONG&gt;Display the values in this column with commas as a thousand separator&lt;/STRONG&gt;&lt;/U&gt; to 2&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is as follow:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 02:11:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3665154#M142068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-29T02:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: calculate % based on multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3665589#M142087</link>
      <description>&lt;P&gt;This is PERFECT! Thank you so much. I really appreciate your time and help.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 07:34:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-based-on-multiple-criteria/m-p/3665589#M142087</guid>
      <dc:creator>bree_carter</dc:creator>
      <dc:date>2024-01-29T07:34:32Z</dc:date>
    </item>
  </channel>
</rss>

