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
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] ))

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