5 Replies Latest reply on Aug 13, 2018 9:57 AM by sundeepkumar.chintha

# LAST MONTH AND MOM MEASURE

Hi All,

I am new to  Tableau. I want to calculate Last Month Measure .

I have tran amt  , need trans amt measure  for last month and calculate    (this month -last month/last month) month over month diff and apply threshold on it. If  >%10 green up arrow and <10% red down arrow.

I have  month column and previous month column also .

Please any one help me creating this.

• ###### 1. Re: LAST MONTH AND MOM MEASURE

Hi Sundeep,

Could you please attach the workbook with some sample data or mock data so that it will be helpful to solve the use case

BR,

NB

• ###### 2. Re: LAST MONTH AND MOM MEASURE

Hi Sandeep,

Do you mean like this ?

STEP 1

Make use of inbuilt % diff as below

STEP 2

Use below calculation and drag to shapes and give 10% condition (or say .1 here )

(ZN(SUM([Amount])) - LOOKUP(ZN(SUM([Amount])), -1)) / ABS(LOOKUP(ZN(SUM([Amount])), -1))    > .1  (this is nothing but I just expanded Table Calculation from the shelve )

Also drag another copy of this cal to Colours and give green and red colours

Thanks,

Ritesh

Please mark the answer as CORRECT & HELPFUL if it really helped you so that it can help others as well

Attached workbook as well

• ###### 3. Re: LAST MONTH AND MOM MEASURE

here % diff showing  wrong values.

% diff shld be like

(([Tran Cnt] - [Tran Cnt LM]) / [Tran Cnt LM])

here Tran Cnt LM is last month data and tran cnt brings this month data.

i.e   (201807-201806)/(201806)

ex:  Books sales for 201807  - \$5000

Books sales for 201806  -\$ 4000

Month over month diff is = 5000-4000/4000= 0.25

hope u got guys ..

• ###### 4. Re: LAST MONTH AND MOM MEASURE

I did some thing  u explained me.

Its working fine when there is no drop down filter  but  when I keep month as drop down  and  select specific month the values showing wrong .

if I select two months its working fine(here I have only 2 months data)

any thing I need to do ..

I want to keep  month as selector .

attached scrren shot.

• ###### 5. Re: LAST MONTH AND MOM MEASURE

any help on this ?