cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

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
v-cherch-msft Super Contributor
Super Contributor

Re: Sum Dax help

Hi @Anonymous

 

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.
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


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

7 REPLIES 7
Anonymous
Not applicable

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

Anonymous
Not applicable

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

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


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

v-cherch-msft Super Contributor
Super Contributor

Re: Sum Dax help

Hi @Anonymous

 

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.
Anonymous
Not applicable

Re: sum dax help

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

Anonymous
Not applicable

Re: Sum Dax help

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

Anonymous
Not applicable

Re: Sum Dax help

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

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 59 members 1,197 guests
Please welcome our newest community members: