DerekK
Board Regular
- Joined
- Jun 18, 2007
- Messages
- 93
- Office Version
- 2003 or older
- Platform
- Windows
This query pertains to Power Pivot in Excel 2016.
I have a table containing every annual contract, past and present, which includes contract end dates and amounts. (I also have two separate related tables, one for client and one for calendar.)
I'm trying to write a measure for a pivot table that will return the contract amount for those customers whose contract ends within the current fiscal year but who have not yet renewed. (The last, or most recent, contract end date of those who have renewed would then fall outside the current fiscal year.) The measure would look something like this --
-- but I get the error, "DatesBetween and DatesInPeriod functions are only accepting date column reference as a first argument." I've tried to create a "virtual" date column using ADDCOLUMNS and SUMMARIZE but Power Pivot is having none of it.
Can anyone please recommend a workaround for this?
I have a table containing every annual contract, past and present, which includes contract end dates and amounts. (I also have two separate related tables, one for client and one for calendar.)
I'm trying to write a measure for a pivot table that will return the contract amount for those customers whose contract ends within the current fiscal year but who have not yet renewed. (The last, or most recent, contract end date of those who have renewed would then fall outside the current fiscal year.) The measure would look something like this --
Code:
amt2018:=CALCULATE (
SUM ( Contracts[Amount] ) ,
DATESBETWEEN (
LASTDATE ( Contracts[Contract End Date] ,
DATE ( 2019 , 4 , 1 ) ,
DATE (2020 , 3, 31 )
)
-- but I get the error, "DatesBetween and DatesInPeriod functions are only accepting date column reference as a first argument." I've tried to create a "virtual" date column using ADDCOLUMNS and SUMMARIZE but Power Pivot is having none of it.
Can anyone please recommend a workaround for this?
Last edited: