<?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: Best approach to obtain different level of averages in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2378564#M61380</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , I think you need to use isinscope &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/" target="_blank"&gt;https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2022 12:11:27 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-03-07T12:11:27Z</dc:date>
    <item>
      <title>Best approach to obtain different level of averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2378497#M61375</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a long time Excel user, rather at advanced level, however am rather new to PowerBI. I have been playing around my data but I am unsuccesful at obtaining what I need. I am truly sorry to be this demanding but I have stumbled upon my limit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Context:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I am building a Dashboard to measure our performance/poductivity&lt;/LI&gt;&lt;LI&gt;It is realted to project management and based on Sprints&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I need:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Calculate the average productivity per person per sprint&lt;/LI&gt;&lt;LI&gt;Calculate the team average productivity per sprint&lt;/LI&gt;&lt;LI&gt;Calculate the best performer per sprint&lt;/LI&gt;&lt;LI&gt;Calculate the global average productivity of all time&lt;/LI&gt;&lt;LI&gt;Calculate the best performer of all time&lt;/LI&gt;&lt;LI&gt;We measure the productivity based on the Sum of Weight of Tasks / Quantity of Days Worked in the sprint&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data Structure:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Main source of information (contains most relevant information)&lt;/LI&gt;&lt;LI&gt;Working Days = a separate table that has the worked days by matching Assignee name and Sprint&lt;/LI&gt;&lt;LI&gt;Attached is a Pbix with my attempts to make it work and also a clean Pbix if anyone has a better approach.&lt;UL&gt;&lt;LI&gt;&lt;A title="PBI Folder with both files" href="https://drive.google.com/drive/folders/1HYsEZUbc7WaH1MaDDb0hPSNffgpcxJiG?usp=sharing" target="_blank" rel="noopener"&gt;PBI Folder with both files&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the best approach for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks to any help you can provide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 11:11:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2378497#M61375</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-07T11:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Best approach to obtain different level of averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2378564#M61380</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , I think you need to use isinscope &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/" target="_blank"&gt;https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 12:11:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2378564#M61380</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-07T12:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Best approach to obtain different level of averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2378997#M61403</link>
      <description>&lt;P&gt;Hi&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;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just tried it on several levels and obtained the following message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Mar 2022 15:06:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2378997#M61403</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-07T15:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Best approach to obtain different level of averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2379000#M61404</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; ,share measure to check &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 15:07:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2379000#M61404</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-07T15:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Best approach to obtain different level of averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2379009#M61406</link>
      <description>&lt;P&gt;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Productivity =
sum(Data[Weight])/
calculate(sum(WorkingDays[WorkingDays]);
ISINSCOPE(WorkingDays[Sprint]);
ISINSCOPE(WorkingDays[Working Days]))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Mar 2022 15:13:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2379009#M61406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-07T15:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Best approach to obtain different level of averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2379326#M61425</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I guess there are multiple options, but you can try the next approaches:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;average_productivity = 
VAR _weight = SUM ( Data[Weight] )
VAR c_sprint = SELECTEDVALUE ( Data[Sprint Name] )
VAR w_days = CALCULATE ( SUM ( WorkingDays[Working Days] ), WorkingDays[Sprint] = c_sprint )
RETURN
    IF ( HASONEVALUE ( Data[Sprint Name] ) &amp;amp;&amp;amp; HASONEVALUE(WorkingDays[Assignee Name]), _weight / w_days )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;average_productivity_total = 
VAR empl_amt = DISTINCTCOUNT ( WorkingDays[Assignee Name] )
RETURN
    SUMX ( Data, [average_productivity] ) / empl_amt&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;best_performance = 
VAR t =
    ADDCOLUMNS (
        SUMMARIZE ( WorkingDays, WorkingDays[Assignee Name], WorkingDays[Sprint] ),
        "avgProductivity",
            VAR c_employee = CALCULATE ( SELECTEDVALUE ( WorkingDays[Assignee Name] ) )
            VAR c_sprint = CALCULATE ( SELECTEDVALUE ( WorkingDays[Sprint] ) )
            VAR _weight = CALCULATE (
                    SUM ( Data[Weight] ),
                    Data[Task Assignee Name] = c_employee,
                    Data[Sprint Name] = c_sprint
                )
            VAR w_days = CALCULATE ( SUM ( WorkingDays[Working Days] ), WorkingDays[Sprint] = c_sprint )
            RETURN
                _weight / w_days
    )
RETURN
    MAXX (
        FILTER ( t, [Sprint] IN VALUES ( Data[Sprint Name] ) ),
        [avgProductivity]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;average_productivity_all_time = CALCULATE( [average_productivity_total], ALL(Data[Sprint Name]))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;best_performer (all time) = 
VAR t =
    ADDCOLUMNS (
        SUMMARIZE ( WorkingDays, WorkingDays[Assignee Name], WorkingDays[Sprint] ),
        "avgProductivity",
            VAR c_employee = CALCULATE ( SELECTEDVALUE ( WorkingDays[Assignee Name] ) )
            VAR c_sprint = CALCULATE ( SELECTEDVALUE ( WorkingDays[Sprint] ) )
            VAR _weight = CALCULATE (
                    SUM ( Data[Weight] ),
                    Data[Task Assignee Name] = c_employee,
                    Data[Sprint Name] = c_sprint
                )
            VAR w_days = CALCULATE ( SUM ( WorkingDays[Working Days] ), WorkingDays[Sprint] = c_sprint )
            RETURN
                _weight / w_days
    )
var maxV = MAXX ( t, [avgProductivity])
RETURN
    MAXX ( FILTER(t, [avgProductivity] = maxV), [Assignee Name] )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2" color="#333399"&gt;&lt;EM&gt;If this post helps, then please consider &lt;U&gt;Accept it as the solution&lt;/U&gt; &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;to help the other members find it more quickly.&lt;BR /&gt;&lt;BR /&gt;I am a Ukrainian living in Ukraine. Please, help us to survive! &lt;STRONG&gt;Please, Ask your government to react!&lt;/STRONG&gt;&lt;BR /&gt;Here are official ways you can support us financially (accounts with multiple currencies):&lt;BR /&gt;&lt;A href="https://bank.gov.ua/ua/about/support-the-armed-forces" target="_blank"&gt;https://bank.gov.ua/ua/about/support-the-armed-forces&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;USD:&lt;BR /&gt;BENEFICIARY: National Bank of Ukraine&lt;BR /&gt;BENEFICIARY BIC: NBUA UA UX&lt;BR /&gt;BENEFICIARY ADDRESS: 9 Instytutska St, Kyiv, 01601, Ukraine&lt;BR /&gt;ACCOUNT NUMBER: 400807238&lt;BR /&gt;BENEFICIARY BANK NAME: JP MORGAN CHASE BANK, New York&lt;BR /&gt;BENEFICIARY BANK BIC: CHASUS33&lt;BR /&gt;ABA 0210 0002 1&lt;BR /&gt;BENEFICIARY BANK ADDRESS: 383 Madison Avenue, New York, NY 10017, USA&lt;BR /&gt;PURPOSE OF PAYMENT: for crediting account 47330992708&lt;BR /&gt;&lt;BR /&gt;Accounts details for other currencies (EUR|GBP|CHF|AUD|CAD|PLN) can be found here: &lt;A href="https://bank.gov.ua/ua/about/support-the-armed-forces" target="_blank"&gt;https://bank.gov.ua/ua/about/support-the-armed-forces&lt;/A&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 17:16:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2379326#M61425</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2022-03-07T17:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Best approach to obtain different level of averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2385903#M61808</link>
      <description>&lt;P&gt;This helped me work on the right direction, had to make a few adjustments to some measures to find the right behaviour with filters. Amazing!!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 11:04:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Best-approach-to-obtain-different-level-of-averages/m-p/2385903#M61808</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-10T11:04:30Z</dc:date>
    </item>
  </channel>
</rss>

