Hello all I've been trying to get used to uisng the syntax of nesting the Filter and All functions inside Calculate , as this seems to be the correct thing to do rather than just using the CALCULATE 'built in filter.
I have two measures for a running total month by month ;
This is how I orignialy would have entered it and it understands the filter context when a 'criteria' is dropped into the pivot table.
< trytwo:=VAR ddate = MAX(Table1[Date]) RETURN
CALCULATE(SUM(Table1[number]),Table1[Date]<= ddate && Table1[Date]> EOMONTH(ddate,-1)) >
This is how I've been trying to write it
<
< CALCULATE(SUM(Table1[number]),
FILTER(ALL(Table1),Table1[Date]<= sdate && Table1[Date]> EOMONTH(sdate,-1))) >
The problem I've come across is that this does not recognize the criteria when in a pivot table? how can I correct this, I appreciate both may be useful but I'd like to know how to control it better.
I've attached a very (very) simple workbook with a p table showing the difference . Any help or pointer gratefully recieived.
Richard.
Bookmarks