Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
@Anonymous
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]
)
@Anonymous
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
User | Count |
---|---|
23 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |