Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Aggregate / sum id based on 3 activities per day

Hello,

 

I have this table:

 

iddateactivityactivity_count
3081-Jun-22a312
3081-Jun-22c39
3081-Jun-22b80
3082-Jun-22c251
3082-Jun-22b222
3083-Jun-22a50
3083-Jun-22c223
3083-Jun-22b171
3084-Jun-22b302
3084-Jun-22c106
3084-Jun-22a23

 

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:

 

3081-Jun-22431

 

This is then repeated per day, per id 

 

3081-Jun-22431
3082-Jun-22402
9413-Jun-22235

 

Any ideas?

 

Cheers,

Carsten

3 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Untitled.png


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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

Try steps as below:

1.enter a table "Activity Table" as below:

veasonfmsft_0-1656410542025.png

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

veasonfmsft_2-1656410705811.png

Best Regards,
Community Support Team _ Eason

 

View solution in original post

Anonymous
Not applicable

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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

v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

Try steps as below:

1.enter a table "Activity Table" as below:

veasonfmsft_0-1656410542025.png

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

veasonfmsft_2-1656410705811.png

Best Regards,
Community Support Team _ Eason

 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Untitled.png


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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.