<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'Conference', 'Communities', and 'PASS'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=Conference,Communities,PASS&amp;orTags=0</link><description>Search results matching tags 'Conference', 'Communities', and 'PASS'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>LASTDATE dates arguments and upcoming events #dax #tabular #powerpivot</title><link>http://sqlblog.com/blogs/marco_russo/archive/2012/10/01/lastdate-dates-arguments-and-upcoming-events-dax-tabular-powerpivot.aspx</link><pubDate>Mon, 01 Oct 2012 17:04:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:45415</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;Recently I&amp;nbsp;had to write a DAX formula containing a LASTDATE within the logical condition of a FILTER: I found that its behavior was not the one I expected and I further investigated. At the end, I wrote my findings in &lt;a href="http://www.sqlbi.com/articles/usage-of-dates-argument-in-a-row-context/"&gt;this article on SQLBI&lt;/a&gt;, which can be applied to any Time Intelligence function with a &amp;lt;dates&amp;gt; argument.&lt;/p&gt;&lt;p&gt;The key point&amp;nbsp;is that when you write &lt;/p&gt;&lt;p&gt;&lt;strong&gt;LASTDATE( table[column] )&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;in reality you obtain something like &lt;/p&gt;&lt;p&gt;&lt;strong&gt;LASTDATE( CALCULATETABLE( VALUES( table[column] ) ) )&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;which converts an existing row context into a filter context.&lt;/p&gt;&lt;p&gt;Thus, if you have something like &lt;/p&gt;&lt;p&gt;&lt;strong&gt;FILTER( table, table[column] = LASTDATE( table[column] )&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;the FILTER will return all the rows of table, whereas you probably want to use &lt;/p&gt;&lt;p&gt;&lt;strong&gt;FILTER( table, table[column]&amp;nbsp;= LASTDATE( VALUES( table[column] ) ) )&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;so that the existing filter context before executing FILTER is used to get the result from VALUES( table[column] ), avoiding the automatic expansion that would include a CALCULATETABLE that would hide the existing filter context.&lt;/p&gt;&lt;p&gt;If after reading the &lt;a href="http://www.sqlbi.com/articles/usage-of-dates-argument-in-a-row-context/"&gt;article&lt;/a&gt; you want to get more insights, read the Jeffrey Wang's post &lt;a href="http://mdxdax.blogspot.com/2011/01/dax-time-intelligence-functions.html"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;In these days I'm speaking at &lt;a href="http://www.sqlpass.org/sqlrally/2012/nordic/"&gt;SQLRally Nordic 2012&lt;/a&gt;&amp;nbsp;in Copenhagen&amp;nbsp;and I will be in &lt;a href="http://www.sqlbi.com/courses/ssas-workshop-cologne-oct2012/"&gt;Cologne (Germany)&lt;/a&gt; next week for a SSAS Tabular Workshop, whereas Alberto will teach the same workshop in &lt;a href="http://www.sqlbi.com/courses/ssas-workshop-amsterdam-oct2012/"&gt;Amsterdam&lt;/a&gt; one week later. Both workshops still have seats available and the Amsterdam's one is still in early bird discount until October 3rd!&lt;/p&gt;&lt;p&gt;Then, in November I expect to meet many blog readers at &lt;a href="http://www.sqlpass.org/summit/2012/"&gt;PASS Summit 2012&lt;/a&gt; in Seattle and I hope to find the time to write other article on interesting things on Tabular and PowerPivot. Stay tuned!&lt;/p&gt;</description></item></channel></rss>