
1. Re: Calculation problem
Ken Flerlage Jun 15, 2018 6:38 AM (in response to Niranjan Banarjee)Pretty difficult to answer this question without seeing your data or a sample workbook.


3. Re: Calculation problem
Niranjan Banarjee Jun 15, 2018 7:03 AM (in response to Serg Dmchnk)But Serg just wanted to know why my formula above is not valid

4. Re: Calculation problem
Serg Dmchnk Jun 15, 2018 7:16 AM (in response to Niranjan Banarjee)it's not valid because you're trying to use 2 table calculations simultaneously. That's why Tableau don't get the right order to solve. That's why I woul recommend you to use 2 calculated fields: one for total and second for lookup.

5. Re: Calculation problem
Niranjan Banarjee Jun 15, 2018 7:54 AM (in response to Serg Dmchnk)I tried to separately calculate the Total for previous 12 months data is not happening.
It will be helpful if you can share an sample calculation

6. Re: Calculation problem
Serg Dmchnk Jun 17, 2018 11:57 PM (in response to Niranjan Banarjee)No problem. Please, attach the workbook with sample data and required results. I will reply with all details.

7. Re: Calculation problem
David Maning Jun 18, 2018 1:10 AM (in response to Serg Dmchnk)Hi Serg,
I suggest to use LOD for you task and get rid from unnecessary overloading.
For example (Superstore data set is used):
MIN({ FIXED [Category], DATETRUNC('month', [Order Date]): SUM([Sales])})
/
MIN({ FIXED DATETRUNC('month', [Order Date]):SUM([Sales])})

LOOKUP(MIN({ FIXED [Category], DATETRUNC('month', [Order Date]):SUM([Sales])}), 12)
/
LOOKUP(MIN({ FIXED DATETRUNC('month', [Order Date]):SUM([Sales])}), 12)
Trust this helps.
D

8. Re: Calculation problem
Sohan Jawar Jun 18, 2018 1:35 AM (in response to Niranjan Banarjee)Hi Niranjan,
Try to create different calculated fields for your calculation.
TotalValue = Total(SUM([Value)])
CurrentMonthValue = ZN(LOOKUP(SUM([Value],0))
12MonthPreviousValue = ZN(LOOKUP(SUM([Value],12))
Share = [CurrentMonthValue]/[TotalValue])  ([12MonthPreviousValue]/[TotalValue])
This should be computed along the Month and year of the date which you are using in the view.
Regards
Sohan.