Solved

In Excel Power Pivot, calculate month-over-month growth using a measure and DAX

Posted on 2014-04-22
1
3,603 Views
Last Modified: 2014-06-03
In my Excel Power Pivot table I have a couple columns:

UsageMonth  (date datatype)
Consumed    (float number)

I want to calculate month-over-month growth. For example, if in January I consumed 100 and in February I consumed 110, 110/100-1 equals .10 or 10% growth.

If my table has this data:

UsageMonth   Consumed
1/1/2014          100
2/1/2014           110

I am thinking I should be able to create, in DAX, a measure named ConsumedPriorMonth. How do I do it?
0
Comment
Question by:RickInBellevue
1 Comment
 

Accepted Solution

by:
RickInBellevue earned 0 total points
ID: 40109078
Okay, I figured out the answer to my own question.

To calculate month-over-month growth, the fundamental formula that underlies the solution is:

(Month2Usage - Month1Usage)/Month1Usage

The DAX-based answer has two parts:

Part 1: Create a measure that calculates the prior month's usage:

PriorMonthUsage:=CALCULATE(SUM(Usage),DATEADD(UsageData[UsageMonth],-1,MONTH))


Part 2:  Compute month-over-month growth:

MoMGrowth:=IF([PriorMonthUsage],(SUM([Usage])-[PriorMonthUsage])/[PriorMonthUsage],BLANK())

The IF/BLANK parts handles the case where there is no usage.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Photo Albums in PowerPoint Photo Albums are a very useful tool in PowerPoint and allow you quickly add a large number of images. The images can be formatted in a variety of ways so that you are able to create a professional looking presentation v…
A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question