6 Replies Latest reply on Jun 17, 2016 1:14 PM by André Coelho

# SUM Selected Measures in Data

Hello Guys!

I'm attaching the workbook here.

I just wanna know how can I sum the measure [Valor] in "Sheet 4".

Thank You!

• ###### 1. Re: SUM Selected Measures in Data

Hey Andre,

Are you just trying to add a Grand Total field?

If so, you can do this:

• ###### 2. Re: SUM Selected Measures in Data

Hi Derrick.

It's not that simple. If you sum those measures in view the result will be R\$2961746,81.

The result adding Grand Total is R\$ 48196664,07.

I'm struggling with it, I thought it would be easier.

I tried window_sum but didn't work fine.

If you could find other solutions it would be great.

Thank you.

• ###### 3. Re: SUM Selected Measures in Data

Hey Andre,

The reason you are seeing 48M is because the total is including the values you are filtering out with "Distance from Origin".

Looking at the calculation, I'm not 100% what it is trying to do, but do you need the window functions there? If we can rewrite that so that it doesn't have them, I think we can adjust this to work correctly.

• ###### 4. Re: SUM Selected Measures in Data

Hi Derrick, the goal of this sheet is to show only the SUM  of selected  (Cities).

The filter "Distance from Origin" was the way I found to show on the map only  within less than the value in filter far, based on latitude and longitude.

First you have to select Origin City, after that you select the max distance on "Distance from Origin" filter. All cities in this distance radius will be shown. Then, I need to calculate the SUM of these values.

I failed miserably trying this SUM.

• ###### 5. Re: SUM Selected Measures in Data

Change it to this:

6371 * ACOS

(