Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
v-xicai
Community Support
Community Support

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
v-xicai
Community Support
Community Support

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.

Anonymous
Not applicable

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.