5 Replies Latest reply on Jan 9, 2019 5:57 AM by Manish Sawjiani

# Previous Month with Current Month where current month is in the filter

Hello All

I need suggestions on how to get previous month value into my view. The view is filtered on the current month. What is interesting is at the calculations of current row level I need to aggregate rows for previous month. Please take a look at screen shot. Please suggest. Thanks very much. This example is from Sample Super Stores and I am getting  just the historical values.

• ###### 1. Re: Previous Month with Current Month where current month is in the filter

Hi, Manish

Can you provide a sample workbook?

ZZ

• ###### 2. Re: Previous Month with Current Month where current month is in the filter

Like this ?

• ###### 3. Re: Previous Month with Current Month where current month is in the filter

Hi Ombir

Nice - but not quiet what I wanted. I would like to filter on Month and Year. Can you propose an alternate solution?

• ###### 4. Re: Previous Month with Current Month where current month is in the filter

Hello Manish,

Here is the way you can solve it

1) Create parameter as below

2) write 2 calculations for current and previous month as below

// Current Month Profit

IIF([Order Date]>=[Parameter 1]

and [Order Date]< DATEADD('month', 1,[Parameter 1]),

([Total Profit]),0)

//Previous month Profit

and [Order Date]< DATEADD('month', 0,[Parameter 1])

,   ([Total Profit]),0)

3) Then write calculation as

4) then draw visualization as below

Data will change according to selection

• ###### 5. Re: Previous Month with Current Month where current month is in the filter

Hi Megha

Thanks very much. Although this works with a parameter based filtering I have problems with finding more or less. Technically I want to put symbols in the chart with a '>' or '<' Please take a look at the attached sheet. Thanks

Manish