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
Gleb
Helper III
Helper III

Sum of values per parameter

Hi! I have a table: 

person_idvalue
10220
10220
10220
10221
10220

And so on, so it is a column, where we have 5 values per one person, I need a column that will show the sum of those 5 values per person, so it will look like this:

person_idvaluesum
102201
102201
102201
102211
102201

What dax formula I need to create a column "sum"

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Gleb 

Please use the following measure 

M = 

CALCULATE (
    SUM( Table[Value]),
    ALLEXCEPT ( table , table[person id])
)




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
daXtreme
Solution Sage
Solution Sage

Is this to be a measure or a calculated column? If a calc column...

[Sum] = // calc column
var vPerson = T[person_id]
var Result =
    SUMX(
        filter(
            T,
            T[person_id] = vPerson
        ),
        T[value]
    )
RETURN
    Result
Jihwan_Kim
Super User
Super User

Hi,

Please try the below to create a new column.

 

Sum CC =
SUMX (
    FILTER (
        'TableName',
        'TableName'[person_id] = EARLIER ( 'TableName'[person_id] )
    ),
    'TableName'[value]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Fowmy
Super User
Super User

@Gleb 

Please use the following measure 

M = 

CALCULATE (
    SUM( Table[Value]),
    ALLEXCEPT ( table , table[person id])
)




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thanks a lot

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.

Top Solution Authors