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
Anonymous
Not applicable

Calculated Column that sums values based on 2 other columns

Hi everyone, I need your help once again.

 

Im trying to create a calculated column that would do something like this:Picture1.png

 

Im trying to get the distinct sum of the values based on the distinct index and activity while disregarding the activities AA and CC. (Not sure if I made sense. haha) Basically, I want the values to only be summed once for each index and activity while still filling up all the rows.

 

 

Thank you,

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

Please create the calculated column with the formula below.

Column =
VAR t =
    SUMMARIZE (
        FILTER (
            Table1,
            NOT ( [Active] IN { "AA", "CC" } )
                && [Index] = EARLIER ( Table1[Index] )
        ),
        [Active],
        [Active Value]
    )
RETURN
    SUMX ( t, [Active Value] )

Here it the output.

Capture.PNG

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

Please create the calculated column with the formula below.

Column =
VAR t =
    SUMMARIZE (
        FILTER (
            Table1,
            NOT ( [Active] IN { "AA", "CC" } )
                && [Index] = EARLIER ( Table1[Index] )
        ),
        [Active],
        [Active Value]
    )
RETURN
    SUMX ( t, [Active Value] )

Here it the output.

Capture.PNG

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you so much @v-piga-msft ! it worked perfectly!


@v-piga-msft wrote:

Hi @Anonymous ,

Please create the calculated column with the formula below.

Column =
VAR t =
    SUMMARIZE (
        FILTER (
            Table1,
            NOT ( [Active] IN { "AA", "CC" } )
                && [Index] = EARLIER ( Table1[Index] )
        ),
        [Active],
        [Active Value]
    )
RETURN
    SUMX ( t, [Active Value] )

Here it the output.

Capture.PNG

Best Regards,

Cherry

 


 

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.