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

Sum up rows by colum

Hi

Below you will a snap shot of my table, I have looked all over for code and hints on how to achieve what I need, but I have had no luck.

 

What I need to do is earthier create a new table or a custom column that basically sums up rows 1 to 5 Count column and puts the total into its own row, then I would need to repeat this process. So the process would be

 

SUM 1 – 5 and  name it the time window which would be as an example 15:00:00 to 16:00:00

SUM 2 – 6 name would be for example 15:15:00 to 16:15:00

SUM 3 – 7

SUM 4 – 8

SUM 5 – 9

SUM 6 - 10

 

But this would happen based on all of my rows.

 

newPNG.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Sum up rows by colum

Hi DAMO16466464644,

 

According to your description, I create sample data to reproduce the scenario. You can implement your demand following steps below.

 

Firstly, add Index column to original table.

 

9.png

 

 

 

 

 

 

Then ,create column named End_Minutes to get the end time, and create measure named Measure1 to get sum for special row.

 

End_Minutes = Table1[Minutes]+TIME(1,0,0)

Measure1 = CALCULATE(SUM(Table1[Count]),FILTER(ALL(Table1),Table1[Index]>=MAX(Table1[Index])&&Table1[Index]<=MIN(Table1[Index])+4))

 

Choose the table to display the result.

10.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Here is my test pbix file link: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ET0_mVIZgixOiq_KiL...

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Re: Sum up rows by colum

Hi DAMO16466464644,

 

According to your description, I create sample data to reproduce the scenario. You can implement your demand following steps below.

 

Firstly, add Index column to original table.

 

9.png

 

 

 

 

 

 

Then ,create column named End_Minutes to get the end time, and create measure named Measure1 to get sum for special row.

 

End_Minutes = Table1[Minutes]+TIME(1,0,0)

Measure1 = CALCULATE(SUM(Table1[Count]),FILTER(ALL(Table1),Table1[Index]>=MAX(Table1[Index])&&Table1[Index]<=MIN(Table1[Index])+4))

 

Choose the table to display the result.

10.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Here is my test pbix file link: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ET0_mVIZgixOiq_KiL...

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Re: Sum up rows by colum

Thank you so much! i have tried so many ways and i even tried an idex but you nailed it on the head thank you!!!!!!

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors