<?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: Sum of maximal value for specific name in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-maximal-value-for-specific-name/m-p/2041803#M45856</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="322371" data-lia-user-login="Maestro" class="lia-mention lia-mention-user"&gt;Maestro&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try this measure: &lt;STRONG&gt;[Edited]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;amount_passed =
COUNTROWS (
    SUMMARIZE (
        FILTER ( 'Table', 'Table'[Passed] = 1 ),
        'Table'[Name],
        "pass", MAX ( 'Table'[Passed] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Appreciate your Kudos&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;!!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2021 08:36:58 GMT</pubDate>
    <dc:creator>VahidDM</dc:creator>
    <dc:date>2021-09-01T08:36:58Z</dc:date>
    <item>
      <title>Sum of maximal value for specific name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-maximal-value-for-specific-name/m-p/2040805#M45817</link>
      <description>&lt;P&gt;Moving from (pivot)tables in Excel to Power BI provides &lt;STRIKE&gt;some&lt;/STRIKE&gt; struggles. I will try to show my struggle as detailed as needed. The case: as a KPI (Key Performance Indicator) in sports I need to know from longitudinal data IF a player passed the benchmark or not (providing a % by dividing passed/all cases). He only needs to pass the benchmark once during the year (multiple matches obviously; benchmark can be different depending on playing position).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Match&lt;/TD&gt;&lt;TD&gt;Total distance covered (m)&lt;/TD&gt;&lt;TD&gt;Benchmark (m)&lt;/TD&gt;&lt;TD&gt;Passed (o=no;1=yes)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Player A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;6000&lt;/TD&gt;&lt;TD&gt;5000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Player B&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;4000&lt;/TD&gt;&lt;TD&gt;5000&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Player C&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;7000&lt;/TD&gt;&lt;TD&gt;6000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Player D&lt;/TD&gt;&lt;TD&gt;0 **&lt;/TD&gt;&lt;TD&gt;1500&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;TD&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Player A&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;5500&lt;/TD&gt;&lt;TD&gt;5000&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Player B&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4000&lt;/TD&gt;&lt;TD&gt;5000&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Player C&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;5000&lt;/TD&gt;&lt;TD&gt;6000&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;** not enough playtime, so data is there, but not included for the KPI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KPI = passed/total&lt;/P&gt;&lt;P&gt;In Excel I would insert a Pivot table on the table above and then use "Max of passed" providing for each player if he ever passed the benchmark and total amount of filled cells (so unique players in this pivot table). The pivot table in this example would look like:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Max of passed&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Player A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Player B&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Player C&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;KPI: 2 out of 3=66.7%&lt;/P&gt;&lt;P&gt;Player D is not included in pivot table, since there is no valid data (0 or 1) Sum of Max of passed is needed, since 'just' sum of passed will provide 2 instead of 1 for player 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Power BI I provided a new measure&amp;nbsp; "amount_players" which is: DISTINCTCOUNT(query1[player]). This will show the amount of players that pass multiple filters (minimum of playing time, team and season). Now I need a measure "amount_passed" but using MAX(X), SUM or a combination does not deliver the right answer. The main struggle appears when a player is able to pass the benchmark for 3 matches; any use of sum wants to enter the player with a '3', but I only want to count him once.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I need to provide more context or sample data, please let me know!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 15:22:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-maximal-value-for-specific-name/m-p/2040805#M45817</guid>
      <dc:creator>Maestro</dc:creator>
      <dc:date>2021-08-26T15:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of maximal value for specific name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-maximal-value-for-specific-name/m-p/2041803#M45856</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="322371" data-lia-user-login="Maestro" class="lia-mention lia-mention-user"&gt;Maestro&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try this measure: &lt;STRONG&gt;[Edited]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;amount_passed =
COUNTROWS (
    SUMMARIZE (
        FILTER ( 'Table', 'Table'[Passed] = 1 ),
        'Table'[Name],
        "pass", MAX ( 'Table'[Passed] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Appreciate your Kudos&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;!!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 08:36:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-maximal-value-for-specific-name/m-p/2041803#M45856</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-09-01T08:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of maximal value for specific name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-maximal-value-for-specific-name/m-p/2042153#M45863</link>
      <description>&lt;P&gt;Thanks for your quick response &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;. It does not work yet; the error (MdxScript(model)(10,80) that in the DAX formula they can't&amp;nbsp; compare Integer (pass yes, no or empty) with Text/String (player name). They suggest to use the VALUE or FORMAT function, but that would only work if I replace Name by a ID-number. Any suggestions to make it work while still using the playernames as strings?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: it worked, after replacing the "1" with 1 as boolean expression within the FILTER:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FILTER ( 'Table', 'Table'[Passed] = 1 ),&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 08:01:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-maximal-value-for-specific-name/m-p/2042153#M45863</guid>
      <dc:creator>Maestro</dc:creator>
      <dc:date>2021-08-31T08:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of maximal value for specific name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-maximal-value-for-specific-name/m-p/2050878#M46121</link>
      <description>&lt;P&gt;Happy to see you sorted it out.&amp;nbsp;&lt;img /&gt;&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;!!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 08:41:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-maximal-value-for-specific-name/m-p/2050878#M46121</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-09-01T08:41:38Z</dc:date>
    </item>
  </channel>
</rss>

