yes, it can be easily done with one Date Parameter and 2 calculated fields. Here are the steps:
-
Create a Date Parameter, call it ‘SelectDate’
-
Create a calculated field called ‘Sales this Month’ with the following formula:
ifelse(dateDiff(Date,${SelectDate},"MM") = 0, {Sales}, 0)
-
Create another calculated field called ‘Sales Previous Month’ with the following formula:
ifelse(dateDiff(Date,${SelectDate},"MM") = 1, {Sales}, 0)
-
Create a Pivot Table with Sales (optional), Sales This Month and Sales Previous Month as Values. It should look like this:
- Go to the Date parameter and Add a control on the page. It will act as a date filter for your visual.
For more info please check this community post
Hope it helps,
GL