I am relatively new to DAX and want to write a formula to compare this quarter with last quarter. I did not have a calendar table to I created one using the 2016 New Date Table command and then linked the Date fields together. Hopefully this is correct.
The formulas I have written are as follows:
This quarter
Previous quarter
When I display the results on the screen it just gives me the total alongside the current year so something is not calculating correctly
eg
2016 PQ = 30
2016 CQ = 30
2017 PQ = 7.5
2017 CQ = 7.5
Total PQ = 37.50
Total CQ = 37.50
which means if I subtract current quarter from previous quarter I always end up with 0
Can someone please point me in the right direction
Many thanks
The formulas I have written are as follows:
This quarter
Code:
=CALCULATE(sum([Profit]),dateadd('Calendar'[Date],0,QUARTER))
Previous quarter
Code:
=CALCULATE(sum([Profit]),DATEADD('Calendar'[Date],-1,QUARTER))
When I display the results on the screen it just gives me the total alongside the current year so something is not calculating correctly
eg
2016 PQ = 30
2016 CQ = 30
2017 PQ = 7.5
2017 CQ = 7.5
Total PQ = 37.50
Total CQ = 37.50
which means if I subtract current quarter from previous quarter I always end up with 0
Can someone please point me in the right direction
Many thanks