Business Intelligence Blogs

View blogs by industry experts on topics such as SSAS, SSIS, SSRS, Power BI, Performance Tuning, Azure, Big Data and much more! You can also sign up to post your own business intelligence blog.

MDX Utility Belt of Calculations Part 3

  • 3 December 2009
  • Author: DevinKnight
  • Number of views: 5320

This is part three in a series of blog posts that will help you build an arsenal of MDX calculations that you can have ready at the drop of a dime.  The first two posts of this blog series use the ParrallelPeriod and PrevMember functions to return data at different levels.

All of these blog posts are formatted to give you the business problem, a general solution and then the calculation needed to finish the job.  The problem this time will use part of the solution we used from the second blog post.


You need to show the difference in sales of a date and that date's previous member.  (Ex.  Show the sales difference between June and July.  Could likely be a negative number if there are fewer sales in July.)


You can return the sales for the CurrentMember and subtract it from the value of previous member using PrevMember.


The sales for a year minus the sales of the previous year

([Date].[Year].CurrentMember,[Measures].[Sales Amount])-
([Date].[Year].PrevMember,[Measures].[Sales Amount])


The sales for a quarter minus the sales of the previous quarter

([Date].[Quarter].CurrentMember,[Measures].[Sales Amount])-
([Date].[Quarter].PrevMember,[Measures].[Sales Amount])


The sales for a month minus the sales of the previous month

([Date].[Month].CurrentMember,[Measures].[Sales Amount])-
([Date].[Month].PrevMember,[Measures].[Sales Amount])

Rate this article:


Other posts by DevinKnight

Please login or register to post comments.