Forum Discussion
Eriko
11 years agoFrequent Visitor
Calculate the month-over-month
Hello. There are a table "Sales" and a table "Date". I want to do is the following. 1. Outputs Sales Amount of every month. 2. Calculate the month-over-month. I referenced this site,...
- 11 years ago
Just tried something like this which gives me the previous month
Previous month = CALCULATE(SUM('GA Ecommerce'[Sales]),PREVIOUSMONTH('GA Ecommerce'[Date]))
or
Previous Month = CALCULATE(SUM('GA Ecommerce'[Sales]),DATEADD('GA Ecommerce'[Date],-1,MONTH))
Should be pretty easy to do MOM from this.
Jozw126
8 years agoRegular Visitor
Should use DATE column rather than MONTH.
PrevMonthRev = CALCULATE(sum(salesdata[revenue]),PREVIOUSMONTH('date'[DATE]))
PrevMonthRev = CALCULATE(sum(salesdata[revenue]),PREVIOUSMONTH('date'[DATE]))
Anonymous
6 years agoNot applicable
Thank you for suggesting this, I made a change that worked for calculating the day over day using this methodology:
NON-WORKING EXAMPLE:
aov dod% =
VAR __PREV_DAY =
CALCULATE(
SUM('20200918__Dailies'[aov]),
PREVIOUSDAY('20200918__Dailies'[inv_date].[date])
)
RETURN
DIVIDE(SUM('20200918__Dailies'[aov]) - __PREV_DAY, __PREV_DAY)
SOLUTION:
1. Imported a date table
2. Joined the date and the inv_date in relationships
3. Modified column name referenced below
WORKING EXAMPLE:
aov dod% =
VAR __PREV_DAY =
CALCULATE(
SUM('20200918__Dailies'[aov]),
PREVIOUSDAY('20200918__Dailies'[inv_date])
)
RETURN
DIVIDE(SUM('20200918__Dailies'[aov]) - __PREV_DAY, __PREV_DAY)