<?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: Formula help with Summarize, filter, max date... in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1972218#M43346</link>
    <description>&lt;P&gt;Many thanks, worked perfectly!&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jul 2021 07:20:30 GMT</pubDate>
    <dc:creator>MattAtBP</dc:creator>
    <dc:date>2021-07-22T07:20:30Z</dc:date>
    <item>
      <title>Formula help with Summarize, filter, max date...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1970870#M43287</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a new table that shows the cost of the most recent purchase of 'Product 1', per customer. I've tried a formula using summarize with filter and max date but just not quite getting there. Below is some sample data and the desired result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for looking...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 15:31:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1970870#M43287</guid>
      <dc:creator>MattAtBP</dc:creator>
      <dc:date>2021-07-21T15:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Formula help with Summarize, filter, max date...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1971038#M43302</link>
      <description>&lt;LI-CODE lang="csharp"&gt;[Your table] = // calulated table
CALCULATETABLE(
	GENERATE(
		SUMMARIZE(
			T,
			T[Customer],
			T[Product],
		),
		SELECTCOLUMNS(
			CALCULATETABLE(
				TOPN(1,
					T,
					T[Date],
					DESC
				)
			),
			"Date", T[Date],
			"Cost", T[Cost]
		)
	),
	T[Product] = "product 1"
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 21 Jul 2021 17:18:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1971038#M43302</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-21T17:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Formula help with Summarize, filter, max date...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1971043#M43303</link>
      <description>&lt;P&gt;Another way of calculation:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[Your table] = // calulated table
CALCULATETABLE(

	var Filter_ = 
		ADDCOLUMNS(
			DISTINCT( T[Customer] ),
			"Date", CALCULATE( MAX( T[Date] ) )
		)
	var Result =
		CALCULATETABLE(
			T,
			TREATAS(
				Filter_,
				T[Customer],
				T[Date]
			)
		)
	return
		Result,
		
	T[Product] = "product 1"
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 21 Jul 2021 17:22:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1971043#M43303</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-21T17:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Formula help with Summarize, filter, max date...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1971066#M43309</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;New Table =&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;ADDCOLUMNS (&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;TREATAS (&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;GROUPBY (&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;FILTER ( Data, Data[product] = 1 ),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Customers[customer],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Products[product],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"@datemax", MAXX ( CURRENTGROUP (), Data[date] )&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Data[customer],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Data[product],&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Data[date]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"@cost", CALCULATE ( SUM ( Data[cost] ) )&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/h0d93ooj0765myx/mattatbp.pbix?dl=0" target="_self"&gt;Link to the PBIX file&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 17:36:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1971066#M43309</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-07-21T17:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Formula help with Summarize, filter, max date...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1972218#M43346</link>
      <description>&lt;P&gt;Many thanks, worked perfectly!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 07:20:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1972218#M43346</guid>
      <dc:creator>MattAtBP</dc:creator>
      <dc:date>2021-07-22T07:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Formula help with Summarize, filter, max date...</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1972221#M43347</link>
      <description>&lt;P&gt;Thanks Daxer for taking the time to help, works perfectly.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 07:21:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-help-with-Summarize-filter-max-date/m-p/1972221#M43347</guid>
      <dc:creator>MattAtBP</dc:creator>
      <dc:date>2021-07-22T07:21:48Z</dc:date>
    </item>
  </channel>
</rss>

