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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
FelipePalomino
Frequent Visitor

Show total sum of rows into each row

Hey guys!

 

I need a new column where it sums each instance of eash person.

I have a table like this:

 

ID Number

1        5

2        3

3        4

1        2

1        3

2        1

 

And I need something like this:

 

ID | Number | Calculated Column

1         5                       10  

2         3                        4

3         4                        3

1         2                       10

1         3                       10

2         1                        4

 

The biggest problem is: there is another column where I have an exclusive identifier (it's used to relate to another table), for each  row, so differentes instances of the ID 1 have different identifiers. My final goal is to find how many different people have Calculated Column > 5.

 

Can anyone help me?

1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

Hi @FelipePalomino ,

 

Try this code for a column:

CALCULATE(SUM(TABLE[Number]); FILTER(TABLE; TABLE[ID] = EARLIER(TABLE[ID]))

 

In your measure, count it as distinct id where this column is > 5.



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

Proud to be a Super User!



View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@FelipePalomino , try a new column like

SUMX(FILTER(TABLE, TABLE[ID] = EARLIER(TABLE[ID]),TABLE[Number]))

 

or a new measure

calculate(SUM(TABLE[Number]),allexcept(TABLE[ID] ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
camargos88
Community Champion
Community Champion

Hi @FelipePalomino ,

 

Try this code for a column:

CALCULATE(SUM(TABLE[Number]); FILTER(TABLE; TABLE[ID] = EARLIER(TABLE[ID]))

 

In your measure, count it as distinct id where this column is > 5.



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

Proud to be a Super User!



Thanks!!

 

It worked just fine!

 

I have never used this "earlier" before, so you solved the problem and I learned something new. 🙂

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.