Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Sum Dax help

Hi all,

 

Here is scenario wherein we have to calculate the sum based on two condition of the same column and then multiple with the sum of another column and eventually add up the total for a particular quarter i.e. 

 

YearQuarterVesselCodeBus NameStop PointDateHrsLoad
2018Q1TAAmberStart Passage3/15/18 12:00 AM1230
2018Q1TAAmbera3/16/18 12:00 AM120
2018Q1TAAmberEnd passage3/20/18 12:00 AM140
2018Q1TAAmberHalt3/25/18 12:00 AM322000
2018Q1TAAmberStart Passage3/27/18 12:00 AM230
2018Q1TAAmbere3/28/18 12:00 AM560
2018Q2TAAmberf4/2/18 12:00 AM670
2018Q2TAAmberg4/3/18 12:00 AM890
2018Q2TAAmberEnd passage4/4/18 12:00 AM10
2018Q2TAAmberHalt4/5/18 3:00 AM142000
2018Q2TAAmberStart Passage4/5/18 5:00 AM250
2018Q2TAAmbera6/22/18 12:00 AM340
2018Q2TAAmberEnd passage6/24/18 12:00 AM310
2018Q2TAAmberHalt6/26/18 12:00 AM123000
2018Q2TBRadianStart Passage6/26/18 3:00 AM760
2018Q2TBRadiana6/28/18 12:00 AM850
2018Q3TBRadianb7/14/18 12:00 AM64 
2018Q3TBRadianEnd passage7/18/18 12:00 AM540
2018Q3TBRadianHalt7/22/18 12:00 AM512000
2018Q3TBRadianStart Passage7/22/18 6:00 AM350
2018Q4TBRadiant11/29/18 12:00 AM450
2018Q4TBRadianEnd passage12/24/18 12:00 AM130
2018Q4TBRadianHalt12/25/18 12:00 AM1250
2018Q4TBRadianStart Passage12/25/18 12:00 AM20
2019Q1TBRadianon road1/1/19 12:00 AM140
2019Q1TBRadianOn road1/3/19 12:00 AM150

 

 

 

 

 

 

 

For 1st section the hours total would be 181 and load for that travel would be 2000. The total work is 181 * 2000 =362000. in similar fashion for each start and stop point for each bus

 

 

Now we have to calculate the sum for each start and till halt stop point for each bus and same goes for each cargo. then we would need to multiply the sum of hrs and some of cargo for that start till halt point for that voyage

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi all,

     

    Here is scenario wherein we have to calculate the sum based on two condition of the same column and then multiple with the sum of another column and eventually add up the total for a particular quarter i.e. 

     

    YearQuarterVesselCodeBus NameStop PointDateHrsLoad
    2018Q1TAAmberStart Passage3/15/18 12:00 AM1230
    2018Q1TAAmbera3/16/18 12:00 AM120
    2018Q1TAAmberEnd passage3/20/18 12:00 AM140
    2018Q1TAAmberHalt3/25/18 12:00 AM322000
    2018Q1TAAmberStart Passage3/27/18 12:00 AM230
    2018Q1TAAmbere3/28/18 12:00 AM560
    2018Q2TAAmberf4/2/18 12:00 AM670
    2018Q2TAAmberg4/3/18 12:00 AM890
    2018Q2TAAmberEnd passage4/4/18 12:00 AM10
    2018Q2TAAmberHalt4/5/18 3:00 AM142000
    2018Q2TAAmberStart Passage4/5/18 5:00 AM250
    2018Q2TAAmbera6/22/18 12:00 AM340
    2018Q2TAAmberEnd passage6/24/18 12:00 AM310
    2018Q2TAAmberHalt6/26/18 12:00 AM123000
    2018Q2TBRadianStart Passage6/26/18 3:00 AM760
    2018Q2TBRadiana6/28/18 12:00 AM850
    2018Q3TBRadianb7/14/18 12:00 AM64 
    2018Q3TBRadianEnd passage7/18/18 12:00 AM540
    2018Q3TBRadianHalt7/22/18 12:00 AM512000
    2018Q3TBRadianStart Passage7/22/18 6:00 AM350
    2018Q4TBRadiant11/29/18 12:00 AM450
    2018Q4TBRadianEnd passage12/24/18 12:00 AM130
    2018Q4TBRadianHalt12/25/18 12:00 AM1250
    2018Q4TBRadianStart Passage12/25/18 12:00 AM20
    2019Q1TBRadianon road1/1/19 12:00 AM140
    2019Q1TBRadianOn road1/3/19 12:00 AM150

     

     

     

     

     

     

     

    For 1st section the hours total would be 181 and load for that travel would be 2000. The total work is 181 * 2000 =362000. in similar fashion for each start and stop point for each bus

     

     

    Now we have to calculate the sum for each start and till halt stop point for each bus and same goes for each cargo. then we would need to multiply the sum of hrs and some of cargo for that start till halt point for that voyage

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi all,

     

    Here is scenario wherein we have to calculate the sum based on two condition of the same column and then multiple with the sum of another column and eventually add up the total for a particular quarter i.e. 

     

    YearQuarterVesselCodeBus NameStop PointDateHrsLoad
    2018Q1TAAmberStart Passage3/15/18 12:00 AM1230
    2018Q1TAAmbera3/16/18 12:00 AM120
    2018Q1TAAmberEnd passage3/20/18 12:00 AM140
    2018Q1TAAmberHalt3/25/18 12:00 AM322000
    2018Q1TAAmberStart Passage3/27/18 12:00 AM230
    2018Q1TAAmbere3/28/18 12:00 AM560
    2018Q2TAAmberf4/2/18 12:00 AM670
    2018Q2TAAmberg4/3/18 12:00 AM890
    2018Q2TAAmberEnd passage4/4/18 12:00 AM10
    2018Q2TAAmberHalt4/5/18 3:00 AM142000
    2018Q2TAAmberStart Passage4/5/18 5:00 AM250
    2018Q2TAAmbera6/22/18 12:00 AM340
    2018Q2TAAmberEnd passage6/24/18 12:00 AM310
    2018Q2TAAmberHalt6/26/18 12:00 AM123000
    2018Q2TBRadianStart Passage6/26/18 3:00 AM760
    2018Q2TBRadiana6/28/18 12:00 AM850
    2018Q3TBRadianb7/14/18 12:00 AM64 
    2018Q3TBRadianEnd passage7/18/18 12:00 AM540
    2018Q3TBRadianHalt7/22/18 12:00 AM512000
    2018Q3TBRadianStart Passage7/22/18 6:00 AM350
    2018Q4TBRadiant11/29/18 12:00 AM450
    2018Q4TBRadianEnd passage12/24/18 12:00 AM130
    2018Q4TBRadianHalt12/25/18 12:00 AM1250
    2018Q4TBRadianStart Passage12/25/18 12:00 AM20
    2019Q1TBRadianon road1/1/19 12:00 AM140
    2019Q1TBRadianOn road1/3/19 12:00 AM150

     

     

     

     

     

     

     

    For 1st section the hours total would be 181 and load for that travel would be 2000. The total work is 181 * 2000 =362000. in similar fashion for each start and stop point for each bus

     

     

    Now we have to calculate the sum for each start and till halt stop point for each bus and same goes for each cargo. then we would need to multiply the sum of hrs and some of cargo for that start till halt point for that voyage

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks so much for the help u guys are super cool , this community is very very helpful:)

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-cherch-msft  - Thanks so much for the help u guys are super cool , this community is very very helpful