Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Help with calculate multiple column in the same table filtered by one of the column

Dear All, 

 

I am having trouble calculating sum of coulmn by filtering two or more coulmn. 

 

In the below table I'm trying to calculate the the sales for any country from [Final Location] to sum 1st stop location and 2nd stop location based on the filter which matchs the [Final Location].

 

Please ask me if it's not clear.

 

DateSales 1st stop location2nd stop location3rd stop locationFinal Location
6/12/2019 $          2,158DjiboutiSomaliaIndiaIndia
7/2/2019 $              525SomaliaTajikistanIndiaIndia
7/8/2019 $          2,415TajikistanIndiaIndiaSingapore
7/22/2019 $              215IndiaIndiaSingaporeThailand
11/6/2019 $              212IndiaIndiaThailandIndia
6/12/2019 $        21,585IndiaBangladeshIndiaIndia
7/2/2019 $              899SingaporeHong KongIndiaIndia
7/8/2019 $              484ThailandIndiaIndiaIndia
7/22/2019 $          5,416IndiaIndiaIndiaIndia
7/23/2019 $              954IndiaIndiaIndiaIndia
7/24/2019 $          7,854BangladeshIndiaIndiaIndia
7/25/2019 $              658IndiaIndiaIndiaIndia
7/26/2019 $              254IndiaIndiaIndiaThailand
7/27/2019 $                96Hong KongIndiaThailandSingapore
7/28/2019 $              411IndiaIndiaSingaporeDjibouti
7/29/2019 $              471IndiaIndiaDjiboutiSomalia
7/30/2019 $              111Thailand SomaliaThailand
7/31/2019 $          1,001Singapore TajikistanIndia
8/1/2019 $                81Djibouti IndiaIndia
8/2/2019 $              945Somalia IndiaIndia
8/3/2019 $              894Tajikistan IndiaIndia
8/4/2019 $              525India BangladeshIndia
8/5/2019 $          2,415India Hong KongIndia
8/6/2019 $              215India IndiaIndia
8/7/2019 $              212Bangladesh IndiaIndia
8/8/2019 $        21,585Hong Kong India 
8/9/2019 $              899India India 
8/10/2019 $              484India   
8/11/2019 $              485India   
8/12/2019 $              486India   
8/13/2019 $              487India   
8/14/2019 $              555India   
8/15/2019 $              489India   
8/16/2019 $          1,561India   
8/17/2019 $              491India   
8/18/2019 $              492India   
8/19/2019 $              484India   

 

Expected Result: 

 

Estimated
locationsales sum of 1st stopsales sum of 2st stop
India  $                          21,584 $                                   25,415
Somalia  $                             6,521 $  687

 

Thanks!

2 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi Anonymous ,

    I still have a little confused about your logic based on your data sample and your expected output.

    If it is convenient, could you make an example for sales sum of 1st stop so that we could help further on it?

    In addition, what is the location column from in your expected result?

    Best  Regards,

    Cherry

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    I apologize for the confusion. Please refer to the explaination below: 

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    v-piga-msft 

    Thank you,