Forum Discussion

VinnyH's avatar
VinnyH
Frequent Visitor
7 years ago
Solved

Dynamic Variance Month to Month

I've been trying all day to get a variance measure to work for the below matrix.

The data is filtered and split into the matrix according to the below screenshots.

 

 

What I'm trying to show is the difference in margin from one month to the next in as dynamic a way as possible.

Example: I could click the July column and the difference in margin from June would be displayed, and then click on June and the difference from May would be displayed, and so on.

 

 

 

I've experimented with a few measures I've pinched from some other questions of a similar nature to no avail:

 

ThisMonth = CALCULATE(SUM('AllMonths'[True Margin]),PARALLELPERIOD(AllMonths[Date],0,MONTH))
PrevMonth = CALCULATE(SUM('AllMonths'[True Margin]),PARALLELPERIOD('AllMonths'[Date],-1,MONTH))
Difference = [ThisMonth]-[PrevMonth]
 
I've had a small amount of success with the above, however a snag has been that I've had to hold Ctrl & click the second column to indicate which columns I'd like to show the difference between. The problem I've found with this is this displays correctly for the current month variance vs most recent previous month (July vs June respectively). But past that the sums seem to add together rather than show a variance, leading me to believe the measures aren't dynamic past the first Month's data.
 
Any help would be greatly appreciated.