<?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 Sum of latest values based on the latest distinct value of another column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-latest-values-based-on-the-latest-distinct-value-of/m-p/2261847#M54716</link>
    <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;&lt;BR /&gt;For context, the title column is named after project sites and the worker and staff columns indicate the strength at the point of time. How can I sum the latest worker and staff values from all sites?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Alois&lt;/P&gt;</description>
    <pubDate>Fri, 31 Dec 2021 04:43:20 GMT</pubDate>
    <dc:creator>AloisOh</dc:creator>
    <dc:date>2021-12-31T04:43:20Z</dc:date>
    <item>
      <title>Sum of latest values based on the latest distinct value of another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-latest-values-based-on-the-latest-distinct-value-of/m-p/2261847#M54716</link>
      <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;&lt;BR /&gt;For context, the title column is named after project sites and the worker and staff columns indicate the strength at the point of time. How can I sum the latest worker and staff values from all sites?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Alois&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 04:43:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-latest-values-based-on-the-latest-distinct-value-of/m-p/2261847#M54716</guid>
      <dc:creator>AloisOh</dc:creator>
      <dc:date>2021-12-31T04:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of latest values based on the latest distinct value of another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-latest-values-based-on-the-latest-distinct-value-of/m-p/2261864#M54717</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="319224" data-lia-user-login="AloisOh" class="lia-mention lia-mention-user"&gt;AloisOh&lt;/a&gt; , do you have the site and date? &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to try a measure like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measure = &lt;BR /&gt;VAR __id = MAX ('Table'[site] )&lt;BR /&gt;VAR __date = CALCULATE ( MAX('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[site] = __id ) &lt;BR /&gt;CALCULATE ( Sum ('Table'[Worker] ), VALUES ('Table'[site] ),'Table'[site] = __id,'Table'[Date] = __date )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 05:12:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-latest-values-based-on-the-latest-distinct-value-of/m-p/2261864#M54717</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-12-31T05:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of latest values based on the latest distinct value of another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-latest-values-based-on-the-latest-distinct-value-of/m-p/2262142#M54735</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="319224" data-lia-user-login="AloisOh" class="lia-mention lia-mention-user"&gt;AloisOh&lt;/a&gt;&amp;nbsp; &lt;EM&gt;How can I sum the latest worker and staff values from all sites _ &lt;/EM&gt;what indication the table has that defines latest? Is there a Date column or somehing else?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 15:10:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-latest-values-based-on-the-latest-distinct-value-of/m-p/2262142#M54735</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-12-31T15:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of latest values based on the latest distinct value of another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-latest-values-based-on-the-latest-distinct-value-of/m-p/2264651#M54829</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="319224" data-lia-user-login="AloisOh" class="lia-mention lia-mention-user"&gt;AloisOh&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A id="link_21" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/24978" target="_self" aria-label="View Profile of smpa01"&gt;&lt;SPAN class=""&gt;smpa01&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;mentioned, we couldn't find the columns which can distinguish&amp;nbsp;the time sequence, like Date or others. I think&amp;nbsp;the time sequenc&amp;nbsp;is distinguished according to the sequence of the same site. Here I suggest you to add an Index column by Group by Power Query.&lt;/P&gt;
&lt;P&gt;Firstly, Group all rows by [Title] in Power Query.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Go to Advanced editor and add a new line of code that can generate indices in all the previously grouped tables.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Indexed = Table.TransformColumns(#"Grouped Rows", {{"Rows", each Table.AddIndexColumn(_,"GroupIndex", 1, 1)}})&lt;/LI-CODE&gt;
&lt;P&gt;Then expand your table and rename column names.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;For reference:&amp;nbsp;&lt;A href="https://datacornering.com/how-to-create-group-index-with-power-query-or-r/" target="_self"&gt;How to create group index with Power Query or R&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum of Latest Worker =
VAR _SUMMARIZE =
    SUMMARIZE (
        'Table',
        'Table'[Title],
        "MAXINDEX", CALCULATE ( MAX ( 'Table'[GroupIndex] ) ),
        "LATESTWORKER",
            CALCULATE (
                SUM ( 'Table'[Worker] ),
                FILTER ( 'Table', 'Table'[GroupIndex] = MAX ( 'Table'[GroupIndex] ) )
            )
    )
RETURN
    SUMX ( _SUMMARIZE, [LATESTWORKER] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Sum of Latest Staff =
VAR _SUMMARIZE =
    SUMMARIZE (
        'Table',
        'Table'[Title],
        "MAXINDEX", CALCULATE ( MAX ( 'Table'[GroupIndex] ) ),
        "LATESTSTAFF",
            CALCULATE (
                SUM ( 'Table'[Staff] ),
                FILTER ( 'Table', 'Table'[GroupIndex] = MAX ( 'Table'[GroupIndex] ) )
            )
    )
RETURN
    SUMX ( _SUMMARIZE, [LATESTSTAFF] )&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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>Tue, 04 Jan 2022 03:10:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-latest-values-based-on-the-latest-distinct-value-of/m-p/2264651#M54829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-04T03:10:03Z</dc:date>
    </item>
  </channel>
</rss>

