<?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: Take the latest value in a subcategory and roll it up to category in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Take-the-latest-value-in-a-subcategory-and-roll-it-up-to/m-p/1039728#M13905</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = SUMX(SUMMARIZE('Table'; 'Table'[Month]; 'Table'[Cat]; 'Table'[SubCat]; "Max"; MAX('Table'[value])); [Max])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Ricardo&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 21 Apr 2020 15:48:12 GMT</pubDate>
    <dc:creator>camargos88</dc:creator>
    <dc:date>2020-04-21T15:48:12Z</dc:date>
    <item>
      <title>Take the latest value in a subcategory and roll it up to category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Take-the-latest-value-in-a-subcategory-and-roll-it-up-to/m-p/1037791#M13857</link>
      <description>Hi Team&lt;BR /&gt;I have a table which has&lt;BR /&gt;Month Cat SubCat. value&lt;BR /&gt;Aug. A. B. 10&lt;BR /&gt;Aug. A. B. 12. —— latest&lt;BR /&gt;Aug. A. C. 13. —— latest&lt;BR /&gt;Sep. A. B. 15 —— latest&lt;BR /&gt;sep. E. D. 30. - latest&lt;BR /&gt;&lt;BR /&gt;In this at subcat level I want to take the latest value at Month level. For this I created a index col and a simple measure Works at subcat level calculate(sum(value),index = a) # a = max(index)&lt;BR /&gt;But the same measure doesn’t work at Cat level as it will take the max of index at cat leve but what I need is at cat level it will sum the underlying sub cats latest values.&lt;BR /&gt;So for Aug for Cat A it should he 12+13 = 25 but the current measure gives 13. Sep for A is 15 etc.&lt;BR /&gt;Help needed!</description>
      <pubDate>Mon, 20 Apr 2020 22:53:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Take-the-latest-value-in-a-subcategory-and-roll-it-up-to/m-p/1037791#M13857</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-20T22:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Take the latest value in a subcategory and roll it up to category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Take-the-latest-value-in-a-subcategory-and-roll-it-up-to/m-p/1039728#M13905</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = SUMX(SUMMARIZE('Table'; 'Table'[Month]; 'Table'[Cat]; 'Table'[SubCat]; "Max"; MAX('Table'[value])); [Max])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Ricardo&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Apr 2020 15:48:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Take-the-latest-value-in-a-subcategory-and-roll-it-up-to/m-p/1039728#M13905</guid>
      <dc:creator>camargos88</dc:creator>
      <dc:date>2020-04-21T15:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Take the latest value in a subcategory and roll it up to category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Take-the-latest-value-in-a-subcategory-and-roll-it-up-to/m-p/1040461#M13937</link>
      <description>&lt;P&gt;This is the correct code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;// Assumption:
// [Index] column establishes the temporal order
// among the entries.
// T is your table.

[Your Measure] =
var __indexesOfInterest	=
	SELECTCOLUMNS(
		ADDCOLUMNS(
			SUMMARIZE(
				T,
				T[Month],
				T[Cat],
				T[SubCat]
			),
			"@index",
				CALCULATE( MAX( T[Index] ) )
		),
		"@index", [@index]
	)
var __result =
	CALCULATE(
		SUM( T[Value] ),
		TREATAS(
			__indexesOfInterest,
			T[Index]
		),
		ALL( T )
	)
return
	__result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 01:01:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Take-the-latest-value-in-a-subcategory-and-roll-it-up-to/m-p/1040461#M13937</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-22T01:01:38Z</dc:date>
    </item>
  </channel>
</rss>

