3 Replies Latest reply on Jul 5, 2018 1:43 AM by Zoerab Zakrijev

# Calculating grand total per month for an area chart

Hi guys,

I am trying to calculate a grand total per month for my area chart. It consists of 4 layers:

- Line 1,

- Line 2,

- Line 3,

- Product A

- Product C

- Line 4

So what I desire is that the totals for line 1, line 2 etc. are summed up together in one grand total per months, so that I can display it in my tooltip.

I can do this by dupblicating my customers reached measure onto the dual-axis, but this is my last option.

So far I've created different calculated fields for each line (and for product A and C to include it into line 3) using LOD expression:

IF [Line]='Line 1'

THEN {FIXED [Iso2], [Product], [MonthExtract] : SUM([Customers Reached])}

END

And then summed up the results from those different cf's into one calculated field GrandTotal, but it doesn't seem to be working, could anyone point me out what exactly I am doing wrong?

Thank you very much!

With kind regards,

Zoerab.

• ###### 1. Re: Calculating grand total per month for an area chart

Hi Zoerab,

{ FIXED DATETRUNC('month', [Date]) : SUM([Customers Reached])}

I have added this into the tooltip:

Is this what you were looking for?

Thanks,

Mavis

• ###### 2. Re: Calculating grand total per month for an area chart

Thank you very much, Liu!

Quick question, how do I do a summation of Product A and C, so that there's only one total for Line 3?

Something like this: {FIXED [Line]: SUM([Clients Reached])}?

• ###### 3. Re: Calculating grand total per month for an area chart

{FIXED [Line], DATETRUNC('month', [Date]): SUM([Clients Reached])}

1 of 1 people found this helpful