<?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 'PowerPivot' and 'DAX'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=PowerPivot,DAX&amp;orTags=0</link><description>Search results matching tags 'PowerPivot' and 'DAX'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Group Sales by Age of Customers #dax #powerpivot #tabular</title><link>http://sqlblog.com/blogs/marco_russo/archive/2013/05/06/group-sales-by-age-of-customers-dax-powerpivot-tabular.aspx</link><pubDate>Mon, 06 May 2013 12:16:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:48800</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;I published an article describing how to implement the &lt;a href="http://www.sqlbi.com/articles/grouping-transactions-by-age-of-customers-in-dax"&gt;grouping of sales transactions by age of customer at the moment of the transaction&lt;/a&gt; by using PowerPivot or Analysis Services. The same pattern can be used also for any kind of banding operation, this specific case is useful also to recycle the formula that gets the exact age of the customer for each transaction.&lt;/p&gt;  &lt;p&gt;An interesting point is related to performance optimization. The technique is based on adding a calculated column in a table that might contain millions of transactions. This is less expensive than adding a column that contains a foreign key and then a relationship between a table containing group definitions and the transactions table. Every relationship is expensive and generates additional structures (you can see more files in the Analysis Services database, too). Adding one or two columns that have a low number of distinct values (10-15 rows) usually has a lower memory cost than creating a relationship with another table. &lt;a href="http://www.sqlbi.com/articles/grouping-transactions-by-age-of-customers-in-dax"&gt;The article&lt;/a&gt; also contains PowerPivot examples for both Excel 2010 and Excel 2013.&lt;/p&gt;  &lt;p&gt;If only I could decouple attribute visualization from physical structure, I would put these “degenerate dimensions” in a separate folder, because in this way such attribute will be included in attributes belonging to the fact table, which might not be so clear in presenting data. However, I understand that such a decoupling could make live very hard to DAX clients (but probably for MDX it could be not a big issue).&lt;/p&gt;</description></item><item><title>DAX Studio for Excel 2013 finally available! #dax #excel #powerpivot #ssas #tabular</title><link>http://sqlblog.com/blogs/marco_russo/archive/2013/05/04/dax-studio-for-excel-2013-finally-available-dax-excel-powerpivot-ssas-tabular.aspx</link><pubDate>Sat, 04 May 2013 05:49:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:48963</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;I'm so happy that &lt;a href="http://www.sqlbi.com/tools/dax-studio/"&gt;DAX Studio&lt;/a&gt; finally supports Excel 2013! As &lt;a href="http://geekswithblogs.net/darrengosbell/archive/2013/05/04/new-release---dax-studio-1.2-with-excel-2013-support.aspx"&gt;Darren Gosbell described in his blog&lt;/a&gt;, this release has a few internal changes that will better support future enhancements. I will port the code to capture the query plan for a query in this new release, but unfortunately it will require some weeks because I'm traveling a lot in these days.&lt;/p&gt;&lt;p&gt;If you write DAX formulas and queries for PowerPivot or Analysis Services Tabular, DAX Studio is a must have tool: do you really want to live without a DAX Editor? There are a lot of possible improvements and I hope other contributors will give their help to &lt;a href="http://daxstudio.codeplex.com/"&gt;this Codeplex project&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>LASTNONBLANK and FIRSTNONBLANK functions work with any column #dax #powerpivot #ssas #tabular</title><link>http://sqlblog.com/blogs/marco_russo/archive/2013/04/19/lastnonblank-and-firstnonblank-functions-work-with-any-column-dax-powerpivot-ssas-tabular.aspx</link><pubDate>Fri, 19 Apr 2013 10:28:50 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:48789</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;During a &lt;a href="http://www.powerpivotworkshop.com/"&gt;PowerPivot Workshop&lt;/a&gt; course we received an interesting question from a student: “Can I use LASTNONBLANK (and FIRSTNONBLANK) with a column which is not a date column?”&lt;/p&gt;  &lt;p&gt;The reason is that we introduce LASTNONBLANK in the Advanced Time Intelligence module, because its typical use case is on a date column. However, you can use these functions on any column, which raises the question about what happens at that point. The sort order used is the one that depends on the data type of the column. If it is a Text column, the alphabetical sort order is the reference order. If it is a number, then the numeric order is the reference.&lt;/p&gt;  &lt;p&gt;What happens if a column has the “Sort By Column” property set to another column? This sort order is &lt;strong&gt;*not considered*&lt;/strong&gt; by LASTNONBLANK and FIRSTNONBLANK functions. Even if a PivotTable shows you data sorted according to Sort by Column property, any DAX formula ignores such a sort order. Thus, be careful writing your DAX queries if you have to do some assumptions on the sort order of a column using DAX functions that rely on sort order, such as LASTNONBLANK and FIRSTNONBLANK.&lt;/p&gt;</description></item><item><title>DAX Time Intelligence for 4-4-5 Calendar, ISO Calendar and other custom ones #dax #powerpivot</title><link>http://sqlblog.com/blogs/marco_russo/archive/2013/02/19/dax-time-intelligence-for-4-4-5-calendar-iso-calendar-and-other-custom-ones-dax-powerpivot.aspx</link><pubDate>Tue, 19 Feb 2013 14:21:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:47663</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;DAX offers a set of Time Intelligence functions that simplify writing DAX expressions such as YTD, YOY and other time-related calculations. However, these functions only works when some assumptions are valid: your periods should be “natural” months and quarter. Some industries, such as retail and manufacturing, are used to accounting periods that are based on weeks instead of months. One month and one quarter are a set of weeks and a week cannot be split in different months, quarter or years. Making DAX working on these custom calendars requires you to write some DAX expression without using the built-in Time Intelligence functions.&lt;/p&gt;  &lt;p&gt;I wrote an article, &lt;a href="http://www.sqlbi.com/articles/week-based-time-intelligence-in-dax/"&gt;Week-Based Time Intelligence in DAX&lt;/a&gt;, which describes how to write the common DAX calculations required on a custom calendar. I also included two samples, one for Excel 2010 and the other for Excel 2013, so that you can easily work on both versions (&lt;a href="http://sqlblog.com/blogs/marco_russo/archive/2013/01/14/powerpivot-compatibility-across-versions.aspx"&gt;as you know&lt;/a&gt;, downgrading a workbook from Excel 2013 to Excel 2010 with PowerPivot is not possible).&lt;/p&gt;  &lt;p&gt;An important tip you will find is that creating a column that contains the number of days elapsed in a year (or the running total of days in the year, if you prefer) makes it easy writing the FILTER required to use the right set of days in each calculation. After all, this technique is very similar to the one you would use in SQL to perform the same calculation, for this reason DAX is considered more intuitive than MDX by developers with a SQL background.&lt;/p&gt;</description></item><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><item><title>Fact Tables with Different Granularities in #PowerPivot and #BISM #Tabular</title><link>http://sqlblog.com/blogs/marco_russo/archive/2012/01/11/fact-tables-with-different-granularities-in-powerpivot-and-bism-tabular.aspx</link><pubDate>Wed, 11 Jan 2012 12:35:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:40880</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;A few weeks ago I received a question that inspired me in writing &lt;a href="http://www.sqlbi.com/articles/budget-and-other-data-at-different-granularities-in-powerpivot/"&gt;this article&lt;/a&gt; about how to handle data at different granularities in PowerPivot and BISM Tabular. I think this is a common pattern when you have a budget table that contains data at an aggregated level (like month and product category) and you want to compare it with sales that are stored at product and day level. This scenario can be handled in a BISM Multidimensional model by using relationship with other attributes in a dimension, but this is not possible in PowerPivot and BISM Tabular because of the lack of attribute relationships in the model. &lt;/p&gt;  &lt;p&gt;In PowerPivot and BISM Tabular you have two issues: first, you have to create a single PivotTable with both Budget and Sales measures; second, you want to blank the budget value when a dimension or an attribute that is not included in the budget is drilled down. After that you may want to split the budget over these dimensions/attributes according with an allocation algorithm. In the &lt;a href="http://www.sqlbi.com/articles/budget-and-other-data-at-different-granularities-in-powerpivot/"&gt;article&lt;/a&gt; I covered the first two issues, whereas the third might be the topic for a future post. The following is the final result you will obtain – OrderQuantity and Budget are the two measures obtained from columns of two different tables, Sales and Budget, that have different granularities.&lt;/p&gt;  &lt;p&gt;&lt;img src="http://www.sqlbi.com/wp-content/uploads/image13.png" /&gt;&lt;/p&gt;  &lt;p&gt;I’d like to get feedback from PowerPivot users that approached the same issue with alternative solutions.&lt;/p&gt;</description></item><item><title>Converting #MDX to #DAX and PowerPivot Workshop online #ppws</title><link>http://sqlblog.com/blogs/marco_russo/archive/2011/11/07/converting-mdx-to-dax-and-powerpivot-workshop-online-ppws.aspx</link><pubDate>Mon, 07 Nov 2011 09:40:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:39671</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;I just published the article &lt;a href="http://www.sqlbi.com/articles/converting-mdx-to-dax-first-steps/"&gt;Converting MDX to DAX – First Steps&lt;/a&gt; on the renewed &lt;a href="http://www.sqlbi.com"&gt;SQLBI&lt;/a&gt; web site about converting MDX to DAX. The reason is that with BISM Tabular in Analysis Services 2012 you will be able to write queries in both DAX and MDX. If you already know MDX, you might wonder how to “translate” your MDX knowledge in DAX. I think that this is another way you can improve your knowledge about DAX: it has different concepts behind and this comparison should be helpful in this purpose. This is a first step in this comparison, I will continue with other articles in this series based on feedback I will get.&lt;/p&gt;  &lt;p&gt;And don’t forget PowerPivot! This is still the best way to start practicing with DAX now and you can solve many reporting needs by just using it. We did a roadshow in Europe in the last month, and now we announce the first &lt;a href="http://www.powerpivotworkshop.com/"&gt;&lt;strong&gt;PowerPivot Workshop online edition&lt;/strong&gt;&lt;/a&gt; dedicated to Far East and Australia! It is scheduled for November 24-25, 2012, with this schedule:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Beijing:&lt;/strong&gt; 8:00am-11:00am / 1:00pm-4:00pm     &lt;br /&gt;&lt;strong&gt;Hong Kong:&lt;/strong&gt; 8:00am-11:00am / 1:00pm-4:00pm&lt;br&gt;--&gt;&lt;strong&gt;Jakarta:&lt;/strong&gt; 7:00am-10:00am / 12:00am-3:00pm&lt;br&gt;--&gt;&lt;strong&gt;Mumbai:&lt;/strong&gt; 5:30am-8:30am / 10:30am-1:30pm&lt;br&gt;--&gt;&lt;strong&gt;New Delhi:&lt;/strong&gt; 5:30am-8:30am / 10:30am-1:30pm     &lt;br /&gt;&lt;strong&gt;Perth:&lt;/strong&gt; 8:00am-11:00am / 1:00pm-4:00pm     &lt;br /&gt;&lt;strong&gt;Seoul:&lt;/strong&gt; 9:00am-12:00am / 2:00pm-5:00pm&lt;br&gt;--&gt;&lt;strong&gt;Shanghai:&lt;/strong&gt; 8:00am-11:00am / 1:00pm-4:00pm     &lt;br /&gt;&lt;strong&gt;Singapore:&lt;/strong&gt; 8:00am-11:00am / 1:00pm-4:00pm&lt;br&gt;--&gt;&lt;strong&gt;Sydney:&lt;/strong&gt; 11:00am-2:00pm / 4:00pm-7:00pm     &lt;br /&gt;&lt;strong&gt;Tokyo:&lt;/strong&gt; 9:00am-12:00am / 2:00pm-5:00pm     &lt;br /&gt;&lt;strong&gt;GMT:&lt;/strong&gt; 0:00am-3:00am / 5:00am-8:00am&lt;/p&gt;  &lt;p&gt;We are defining partnerships with training centers in these countries, after this online edition I hope you will find other options nearest to you. And if you run a training center and are interested in partnership, hurry up and &lt;a href="mailto:info@powerpivotworkshop.com"&gt;contact us&lt;/a&gt; before this online edition (attending the workshop is a requirement for trainers before delivering the same course).&lt;/p&gt;  &lt;p&gt;We know that US and other countries are waiting for the workshop, but we’re working on this, too – more news very soon, I hope!&lt;/p&gt;</description></item><item><title>Median, Moving Average, Quartile and Percentile calculations in #PowerPivot</title><link>http://sqlblog.com/blogs/marco_russo/archive/2011/09/13/median-moving-average-quartile-and-percentile-calculations-in-powerpivot.aspx</link><pubDate>Tue, 13 Sep 2011 04:18:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:38433</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;Javier Guillén wrote several blog post about how to implement certain common calculations in PowerPivot. It is interesting to read his posts not only because of the solutions he propose, but also because he uses several techniques that can be applied in other scenarios.&lt;/p&gt;&lt;p&gt;Here is a list of posts and reasons to read:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://javierguillen.wordpress.com/2011/09/13/calculating-moving-averages-in-powerpivot-dax/"&gt;Calculating Moving Averages in PowerPivot/DAX&lt;/a&gt;: a classical scenario solved by using just a measure and in a very clean way (the average is correctly calculated also when the period available is shorter than the standard period defined for the moving average)&lt;/li&gt;&lt;li&gt;&lt;a&gt;Calculating Median in PowerPivot/DAX&lt;/a&gt;: this is the same calculation I solved in another post with a calculated masure, but Javier shows how to implement in with a measure - this will be much useful with BISM Tabular, whenever you cannot change the data model on the client side like you do easily in PowerPivot by adding a calculated column.&lt;/li&gt;&lt;li&gt;&lt;a href="http://javierguillen.wordpress.com/2011/09/13/quartile-percentile-and-median-in-powerpivot-dax/"&gt;Quartile, Percentile and Median in PowerPivot/DAX&lt;/a&gt;: use an MDX calculated member in a PivotTable of PowerPivot data, with the help of OLAP PivotTable extensions. Do you know that you can inject a DAX expression in a calculated member using this same technique? Probably not, it&amp;nbsp;is not documented anywhere but it is absolutely supported - more about this in a future post!&lt;/li&gt;&lt;/ul&gt;</description></item><item><title>#PowerPivot Workshop in Lisbon - Portugal #ppws</title><link>http://sqlblog.com/blogs/marco_russo/archive/2011/07/29/powerpivot-workshop-in-lisbon-portugal-ppws.aspx</link><pubDate>Fri, 29 Jul 2011 08:25:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:37389</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;Alberto &lt;a href="http://sqlblog.com/blogs/alberto_ferrari/archive/2011/07/28/powerpivot-workshop-in-portugal-powerpivot-ppws.aspx"&gt;anticipated me&lt;/a&gt; announcing our next edition of the &lt;a href="http://www.powerpivotworkshop.com/courses#Lisbon"&gt;PowerPivot Workshop in Lisbon&lt;/a&gt; (Portugal) on September 19-20, 2011. The announcement has been published also on the SQLPort website in Portuguese! But remember, the workshop will be entirely in English!&lt;/p&gt;&lt;p&gt;In this edition of the workshop we are integrating in the course the new feature of the next version of PowerPivot "Denali" (now available&amp;nbsp;in CTP3). We are also improving the content thanks to the feedback gathered in the past workshops. We had good feedback,in past editions, but we are never completely satisfied and we always want to improve... visit &lt;a href="http://www.powerpivotworkshop.com"&gt;www.powerpivotworkshop.com&lt;/a&gt; for more information.&lt;/p&gt;&lt;p&gt;See you in Lisbon!&lt;/p&gt;</description></item><item><title>Parent-child special calculations in #BISM #Tabular #Denali</title><link>http://sqlblog.com/blogs/marco_russo/archive/2011/07/22/parent-child-special-calculations-in-bism-tabular-denali.aspx</link><pubDate>Fri, 22 Jul 2011 07:55:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:37157</guid><dc:creator>sqlbi</dc:creator><description>&lt;p&gt;Alberto Ferrari published an &lt;a href="http://sqlblog.com/blogs/alberto_ferrari/archive/2011/07/20/tabular-parent-child-dimensions-sumofleaves-and-the-calculate-wall.aspx"&gt;interesting blog post&lt;/a&gt; regarding how to write particular calculations over a parent-child hierarchy in PowerPivot Denali (and in BISM Tabular, of course). One case is the Sum of Leaves (summing only the leaves of a parent-child hierarchy) and the other is the Sum of Children (computes all the nodes that are descendants of the current node, excluding the value of the current node).&lt;/p&gt;  &lt;p&gt;It is always more interesting the fact that DAX can perform calculation over hierarchies, without having specific commands to navigate in a hierarchical structure. The results is not so easy to write, but it works and is probably pretty efficient.&lt;/p&gt;</description></item></channel></rss>