Quantcast
Channel: Service topics
Viewing all articles
Browse latest Browse all 61666

Column totals incorrect with PREVIOUSMONTH measure

$
0
0

The values in the red are caluclating vs prior year (2016-2015), the values in blue are calculating vs last month (Aug-Jul).  Vs Prior year work fine, Vs Prior Month have peculiar behaviour. Rather than summing the total for the column, it gives me the earliest month's total.. Also uses that to calculate the vs Month column, which throws off the % change column.

 

Vs prior year DAX:

 

 

Sales Prior = CALCULATE([Sales Current],SAMEPERIODLASTYEAR('DimDates'[Date]))

Sales Vs Prior = [Sales Current]-[Sales Prior]

Sales % Prior = DIVIDE([Sales Vs Prior],[Sales Prior])

Vs last motnh DAX:

 

Prior Month = CALCULATE([Sales Current],PREVIOUSMONTH('DimDates'[Date]))

Sales Vs Month = [Sales Current] - [Prior Month]

% Prior Month = DIVIDE([Sales Vs Month], [Prior Month],0)

 

Expected Result:

 

 

Actual Result: 

 

 

 

In case you're wondering, the sort order has no effect on the Prior Month total. 

 

 

Any and all advice would be greatly appreciated!


Viewing all articles
Browse latest Browse all 61666

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>