Solved

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

Posted on 2014-04-22
1
3,373 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today companies are subjected to more-and-more data, and it won't stop any time soon.  But there are obvious opportunities for reducing data, particularly data duplicated among companies.
Companies keep a much closer eye on costs today, so changing to new Technology – Microsoft Office 365 is the smartest move to take.
The viewer will learn how to edit text. This includes Font, Spacing, Resizing, Color, and other special text options.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now