1 of 1 people found this helpful
DATEPART('year',[DATE]) or YEAR([DATE])
^^^ will give you the year of the date ^^^
^^^ will give you the month
You'd then set that calc to be tested in the filter, something like [DATEPARSEYEAR] = YEAR(TODAY()) <--- This would one show data for the current year
Is that what you are trying to parse out? Let me know.
See the attached workbook. I believe it does what you want. In my example I used Order Date as the date we care about, it could be any date. The key was to set up Start and End date calculations and check whether or not the Order Date falls between them then filter only on the ones that do. Then use the parameters you showed to populate the calculated Start/End dates.
Have a look at the following calculations I created in the workbook: Max. Order Date (LOD calc used for the two "Latest" options), Start Date, End Date, Latest First of Month, Latest End of Month, Latest Year Start, Latest Year End, Order Date Filter
And also these parameters (same as yours pretty much): Timeframe, Start Date Param, End Date Param
Let me know if you have any questions.
date_parameter_example.twbx 446.6 KB
Since you already have the parameters, not sure the start date/end date are parameters or not, if not, you can create two for them.
my solution is something like
IF [parameter1] = "Other" then
IF [your date column] >= [start date] and [your date column] < [end date] then
[your value column]
elseif [parameter1] = "Last month" then
[your last month calculation]
elseif [parameter1] = "last year" then
[your last year calculation]
hope this could help