Forum Discussion
DAX
- 9 years ago
Hey,
do you have a separate Calendar table, if not you should ;-) And make sure both tables are related properly.
Then you should give PREVIOUSMONTH a try like so:
CALCULATE(SUM('yourtable'[yournumericcolumn]), PREVIOUSMONTH('calendar'[Date]))Here you will find almost everything about time intelligence with DAX:
http://www.daxpatterns.com/time-patterns/
If you are new to the sometimes mind-boggling DAX statements I would wholeheartedly recommend the following books
also in this sequence
- Analyzing Data with Microsoft Power BI and Power Pivot for Excel
- Dax Patterns 2015
- The Definitive Guide to DAX
All three have been written by Marco Russo and Alberto Ferrari
Hope this gets you started
- 9 years ago
The subtraction can look like this
CALCULATE(SUM('yourtable'[yournumericcolumn])) - CALCULATE(SUM('yourtable'[yournumericcolumn],PREVIOUSMONTH('calendartable'[date]))
Cheers
The subtraction can look like this
CALCULATE(SUM('yourtable'[yournumericcolumn])) - CALCULATE(SUM('yourtable'[yournumericcolumn],PREVIOUSMONTH('calendartable'[date]))
Cheers
Hi TomMartens,
I created a new post here: http://community.powerbi.com/t5/Desktop/Active-Clients/m-p/229032#M102144
AmalrajRRD1,
Could you solve your problem?
as Tom says you need the two measures and then substract them. Example:
Sales = CALCULATE(SUM(Sales[SalesAmount]))
SalesPreviousMonth = CALCULATE (SUM(Sales[SalesAmount]), PREVIOUSMONTH(Sales[SalesAmount])
Diferrence= [Sales] - [SalesPreviousMonth]
If you use the difference measure in a table with months of the rows for example, each month you will see the difference bteween the sales of that month and the sales of the previous month.
Hope that helps
- ContabilidadBI9 years agoHelper III
Then you just need to filter the visualization for thoes years.