Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

DAX Excel 2010: Issues with using DATEADD function with LASTDATE and DATESBETWEEN functions

$
0
0

Version:  Excel 2010 Pro PowerPivots

Problem:  I'm using the following measure in a pivot table using a PowerPivots table DATATable:

=CALCULATE(sum([NetBacklogChange]),DATESBETWEEN(DATES[Date],FIRSTDATE(ALL(DATES[Date])),DATEADD(LASTDATE(DATES[Date]),-1,MONTH)))

The measure is returning a value for the first date in the related DATE Lookup Table although the DATA table column being summed "NetBacklogChange" has no records with values before December 1, 2010.  The measure is giving me an incorrect value for the first date contained in the DATES table (1/1/2009).  It is giving me the sum of NetBacklogChange for all dates in the DATES Table.  Once it gets to December 1, 2010 it returns the correct values.  Hence the 2009-01 period in the pdf (see below) shows $120,936 in the NetBacklog-BEGIN column which should be zero since there is no activity for these records in the DATA Table.

FACTS:  I'm using a DATES Lookup table that contains a record for each day from 1/1/2009 through 12/31/2014.  The DATES Lookup table has been "Marked as Dates Table".  The DATES[Date] column in the DATES table is related to the DATA[WIPMonth] column in the DATA table.  Also please note the YearMonth field is coming from the DATES table and the WIPMonth from the DATA Table when looking at the pdf (see link below). 

Does anyone know what is going on here??

Please refer to pdf file that can be downloaded from the following link:

https://dl.dropboxusercontent.com/u/49380643/WIP%20Backlog%20Report%20Ver%202014-03-31A%20DEV.pdf

Any help would be appreciated.

Regards,


Bob Sutor



Viewing all articles
Browse latest Browse all 11829

Trending Articles



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