Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I have this table:
| id | date | activity | activity_count |
| 308 | 1-Jun-22 | a | 312 |
| 308 | 1-Jun-22 | c | 39 |
| 308 | 1-Jun-22 | b | 80 |
| 308 | 2-Jun-22 | c | 251 |
| 308 | 2-Jun-22 | b | 222 |
| 308 | 3-Jun-22 | a | 50 |
| 308 | 3-Jun-22 | c | 223 |
| 308 | 3-Jun-22 | b | 171 |
| 308 | 4-Jun-22 | b | 302 |
| 308 | 4-Jun-22 | c | 106 |
| 308 | 4-Jun-22 | a | 23 |
I am a bit stuck with how to do the following:
I would like to generate a table or measure that sums the "activity_count" for the 3 activities "activity" (a, b and c), per day, per id
Example: For id 308, the sum of the 3 activities (a, b and c) is 312+39+80 = 431, resulting in one line for this:
| 308 | 1-Jun-22 | 431 |
This is then repeated per day, per id
| 308 | 1-Jun-22 | 431 |
| 308 | 2-Jun-22 | 402 |
| 941 | 3-Jun-22 | 235 |
Any ideas?
Cheers,
Carsten
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Hi, @Anonymous
Try steps as below:
1.enter a table "Activity Table" as below:
2. add a measure like:
Result =
IF (
SELECTEDVALUE ( 'Activity Table'[activity] ) IN VALUES ( 'Table'[activity] ),
CALCULATE (
SUM ( 'Table'[activity_count] ),
FILTER ( 'Table', 'Table'[activity] = MAX ( 'Activity Table'[activity] ) )
),
IF (
SELECTEDVALUE ( 'Activity Table'[activity] ) = "Sum",
CALCULATE ( SUM ( 'Table'[activity_count] ) ),
BLANK ()
)
)
3.apply this new field to a table visual
Best Regards,
Community Support Team _ Eason
Dear all,
Thanks a lot for all your input (very much appreciated) and sorry for my late response. In the end, while working on the report, I have ended up creating a table dedicated to this (data qualit scores), supported by a group by function.
Cheers, Carsten
Dear all,
Thanks a lot for all your input (very much appreciated) and sorry for my late response. In the end, while working on the report, I have ended up creating a table dedicated to this (data qualit scores), supported by a group by function.
Cheers, Carsten
Hi, @Anonymous
Try steps as below:
1.enter a table "Activity Table" as below:
2. add a measure like:
Result =
IF (
SELECTEDVALUE ( 'Activity Table'[activity] ) IN VALUES ( 'Table'[activity] ),
CALCULATE (
SUM ( 'Table'[activity_count] ),
FILTER ( 'Table', 'Table'[activity] = MAX ( 'Activity Table'[activity] ) )
),
IF (
SELECTEDVALUE ( 'Activity Table'[activity] ) = "Sum",
CALCULATE ( SUM ( 'Table'[activity_count] ) ),
BLANK ()
)
)
3.apply this new field to a table visual
Best Regards,
Community Support Team _ Eason
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |