cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vishyM Regular Visitor
Regular Visitor

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Sum Dax help

Hi @vishyM

 

You may try to add a group column and then you may get the measures.Please check the attached file.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Super User
Super User

Re: sum dax help

So, for something like this you are going to need some kind of identifier for "grouping" to occur. For example, your first 3 rows should be 1 and then your next 6 rows should be 2, etc. because they all belong together. You might find my work on Cthulhu of use. 

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Cthulhu/m-p/509739


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


7 REPLIES 7
vishyM Regular Visitor
Regular Visitor

sum values between two criteria

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

vishyM Regular Visitor
Regular Visitor

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

Highlighted
Super User
Super User

Re: sum dax help

So, for something like this you are going to need some kind of identifier for "grouping" to occur. For example, your first 3 rows should be 1 and then your next 6 rows should be 2, etc. because they all belong together. You might find my work on Cthulhu of use. 

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Cthulhu/m-p/509739


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


Community Support Team
Community Support Team

Re: Sum Dax help

Hi @vishyM

 

You may try to add a group column and then you may get the measures.Please check the attached file.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
vishyM Regular Visitor
Regular Visitor

Re: sum dax help

@Greg_Deckler- You are awesome , thanks so much for the help

vishyM Regular Visitor
Regular Visitor

Re: Sum Dax help

Thanks so much for the help u guys are super cool , this community is very very helpfulSmiley Happy

vishyM Regular Visitor
Regular Visitor

Re: Sum Dax help

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