This can be done with a couple of calculated fields and a binary flag. You have the right idea with a parameter. Please see the attached.
1. Create Parameter: Last N days, and Show Parameter Control
2. Calculate Dimension: Today
3. Calculate Dimension: Today - N
4: Calculate Measure: Include order date flag (this determines if each Order Date is greater than or equal to (Today - N)
5. Filter for Include order date flag = True
Let me know if you have questions.
Book2.twbx 1.2 MB
You could do this more than one way, here's a couple of methods;
Create a parameter for your number of days called paramDayCount, set it to your N.
- Create a calculated field called 'IsLastN' with the formula [SaleDate] >= dateadd('day',paramDayCount,Today()) and [SaleDate] <= Today()
- Drag the field to your filters and set it to True.
- This will only leave Sale Dates between your N
- Create a calculated field called LastNSale with the formula SUM(IF [SaleDate] >= dateadd('day',paramDayCount,Today()) and [SaleDate] <= Today() then SALES end )