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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Want to show sum of row values in calculated column

I want the sum of values in a calculated column from other column. For easy understand i have put here a table format for example and Please let me know how can we achieve this result:

i have this table with ID and Score Column, what I want is a calculated column that is running score which shows the sum for first two rows then in second row of calculated column i want the sum of other two rows and then in third row i want the sum for all three and so on.

 

ID       Score    

1          10

2          15

3          20

 

Expecting result

ID       Score    calculated column (running score)

1          10                  10 

2          15                  25 (sum of two rows 10+15)

3          20                  45 (sum of all three and so on)

 

Thanks

 

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

You may refer to below formula:

Column = 
CALCULATE (
    SUM ( Table1[Score] ),
    FILTER ( Table1, Table1[ID] <= EARLIER ( Table1[ID] ) )
)

1.png

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.

View solution in original post

4 REPLIES 4
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

You may refer to below formula:

Column = 
CALCULATE (
    SUM ( Table1[Score] ),
    FILTER ( Table1, Table1[ID] <= EARLIER ( Table1[ID] ) )
)

1.png

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

Thank you so much  @v-cherch-msft .. this worked as per my expectation .... 

AlB
Super User
Super User

Hi @Anonymous

 

Try this for your calc column:

 

 

RunningScore =
CALCULATE ( SUM ( Table1[Score] ), Table1[ID] <= EARLIER ( Table1[ID] ) )

 

Anonymous
Not applicable

Hi,

Thanks for your valuable time but this not worked for my expectation and i got the solution from @v-cherch-msft.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.