6 Replies Latest reply: Aug 21, 2018 9:29 AM by Felipe Andrade

# Creating subtotals in a table

Hi,

How can I create subtotals by either Fruit Country or City?

Thanks

• ###### Re: Creating subtotals in a table

!Maybe something like that?

• ###### Re: Creating subtotals in a table

Is it possible in a straight table?

• ###### Re: Creating subtotals in a table

Sorry I don't understand, yo could me explain a little more

• ###### Re: Creating subtotals in a table

Yes it is. But can you explain more on what are you looking for? It is not very clear for me what you want.

• ###### Re: Creating subtotals in a table

Please see attached sample of the output.

• ###### Re: Creating subtotals in a table

Here is the sample i created:

Your table value is called Sum(Sales), so i will write it like this "[Sum(Sales)]"  for easy understanding.

SUM FOR APPLE:

Sum({<Fruit={'Apple'}>}[Sum(Sales)])

SUM FOR LA

Sum({<City={'LA'}>}[Sum(Sales)])

SUM FOR USA

Sum({<Country={'USA'}>}[Sum(Sales)])

BAR GRAPH:

DIMENSION -> Fruit

MEASURE    -> Sum(Sum(Sales))

PIVOT TABLE:

ROW:

Country

City

Fruit

Column:

void

Measure:

Sum([Sum(Sales)])

Straight table:

In a straight table it is not good practice to use a lot of dimensions, so use the one you think is better.

The straight table is like this:

Columns:

Country

Sum([Sum(Sales)])

I hope that helps.

Like, Mark as the answer and mark as helpful if it is. It helps a lot.

Thanks!