Step1:

Create parameters 1.Start date 2. End Date 3. Filter ON/OFF

Start Date

Untitled.png

End Date

End Date.png

 

Filter ON/OFF

filter.png

 

Step2:

Create Calculation [Date Range]

IF [Filter ON/OFF]="OFF" THEN date([Order Date]) ELSEIF date([Order Date])<[End date] AND date([Order Date])>[Start date] THEN date([Order Date]) END

Step3:

Create new parameter with string list

date parameter.png

Step4:

Create calculation [Date parameter calc]

case [Date Parameter]

When "Year" then Year([Order Date])

When "Quarter" then datepart("quarter",[Order Date])

When "Month" then month([Order Date])

When "Day" then day([Order Date])

End

 

Step5:

Drag [Date Range] into filter and select year or month and select all

 

Step6:

Drag this new calculation [Date parameter calc] in to column and Sales into Row

 

Step7:

Show parameter start date, end date and Date Parameter and select range.