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.
Hi! I have a table:
person_id | value |
1022 | 0 |
1022 | 0 |
1022 | 0 |
1022 | 1 |
1022 | 0 |
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_id | value | sum |
1022 | 0 | 1 |
1022 | 0 | 1 |
1022 | 0 | 1 |
1022 | 1 | 1 |
1022 | 0 | 1 |
What dax formula I need to create a column "sum"
Solved! Go to Solution.
@Gleb
Please use the following measure
M =
CALCULATE (
SUM( Table[Value]),
ALLEXCEPT ( table , table[person id])
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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
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.
@Gleb
Please use the following measure
M =
CALCULATE (
SUM( Table[Value]),
ALLEXCEPT ( table , table[person id])
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks a lot
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
12 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
18 |