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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Ma_Betancour
Frequent Visitor

Calculate the sum of one column based on another column

 

Hello guys,

I'm having issues with a simple measure. I'd like to SUM column MARGIN by OPERATIONS USER only. 

I've tried the following:

a. CALCULATE(SUM('Table'[MARGIN]), ALL('Table' [OPERATIONS USER])) 

b. CALCULATE(SUM('Table'[MARGIN]), FILTER('Table', 'Table'[OPERATIONS USER]))

But neither one of the has given me the right results.

Thanks in advance!

 

 

Table.PNG

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Ma_Betancour,

You can try to use the following measure formula if it meets for your requirement:

Measure =
CALCULATE (
    SUM ( 'Table'[MARGIN] ),
    ALLSELECTED ( 'Table' ),
    VALUES ( 'Table'[OPERATIONS USER] )
)

If above not help, please share some sample data to test:

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I have a similar issue. However, in my case, and to use this example, I want to select distinct operations users.

v-shex-msft
Community Support
Community Support

HI @Ma_Betancour,

You can try to use the following measure formula if it meets for your requirement:

Measure =
CALCULATE (
    SUM ( 'Table'[MARGIN] ),
    ALLSELECTED ( 'Table' ),
    VALUES ( 'Table'[OPERATIONS USER] )
)

If above not help, please share some sample data to test:

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Omega
Impactful Individual
Impactful Individual

Hi, 

 

Try the below measure: 

 

CALCULATE(SUM('Table'[MARGIN]), ALLExcept('Table','Table' [OPERATIONS USER])) 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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