Forum Discussion
Sum Previous Month
Hello!
I have a table that is currently calculating monthly totals from another related table. Here is what my table and CurrentMonthCalculation looks like:
FormTotalMonth =
CALCULATE(
SUM('Activated Forms'[ActivatedFormCount]),
FILTER('Activated Forms', 'Activated Forms'[Organization_Id] = AccountActivity[Id]),
FILTER('Activated Forms', 'Activated Forms'[FormCreatedMonth] = AccountActivity[AccountActivityJoinDate])) +0I would like to do the exact same calculation, except have the results appear in my table one month prior so that I can see the previous months total for that month. How would I go about that?
Desired outcome:
Thanks!
Hi Anonymous,
I would suggest you create a new Date table and try the function dax/previousmonth-function-dax.
The two measure could be like this.
FormTotalMonth = CALCULATE( SUM('Activated Forms'[ActivatedFormCount]), FILTER('Activated Forms', 'Activated Forms'[Organization_Id] = AccountActivity[Id]))FormTotalPrevMonth = CALCULATE ( [FormTotalMonth], PREVIOUSMONTH ( 'date'[date] ) )
Best Regards,
Dale
2 Replies
- Greg_Deckler
Community Champion
See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008 - v-jiascu-msft
Microsoft Employee
Hi Anonymous,
I would suggest you create a new Date table and try the function dax/previousmonth-function-dax.
The two measure could be like this.
FormTotalMonth = CALCULATE( SUM('Activated Forms'[ActivatedFormCount]), FILTER('Activated Forms', 'Activated Forms'[Organization_Id] = AccountActivity[Id]))FormTotalPrevMonth = CALCULATE ( [FormTotalMonth], PREVIOUSMONTH ( 'date'[date] ) )
Best Regards,
Dale