cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chisholmconnor Frequent Visitor
Frequent Visitor

DAX Sum column based on condition in other columns in same table

SumQuestion.PNG

Hello,

 

I have a table with a column of UserIDs that only appear once each of which has a ManagerID as well as a value of Total # of Assets. I want to for each UserID add their Total # of Assets with the Total # of Assets if they match with a ManagerID.

 

For example, UserID UDONEUM has 2 total assets right now but he is JOSWART's manager which he has 1154 assets. Therefore, UDONEUM should have a total of 1156 assets displayed in that last column # of Assets(same column).

 

I have tried multiple functions using SUMX, FILTER, CALCULATE, and SUM but cant seem to get the value I want. I tried

 

=SUMX(FILTER('2','2'[UserID] = '2'[Manager ID]),'2'[Total # of Assets])

=CALCULATE(SUM('2'[Total # of Assets]),FILTER('2','2'[UserID] = '2'[Manager ID]))

 

Thanks!

CC

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
chisholmconnor Frequent Visitor
Frequent Visitor

Re: DAX Sum column based on condition in other columns in same table

@v-danhe-msft I found a DAX function to solve my issue

 

I used = CALCULATE(SUM('3'[# of Assets(total)]),FILTER('3', [Manager ID] = EARLIER('3'[UserID])))

 

Thanks for the help anyways,

CC

2 REPLIES 2
Community Support Team
Community Support Team

Re: DAX Sum column based on condition in other columns in same table

Hi @chisholmconnor,

Could you please tell me if the [Manage ID] has relationships with the [User ID]?

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
chisholmconnor Frequent Visitor
Frequent Visitor

Re: DAX Sum column based on condition in other columns in same table

@v-danhe-msft I found a DAX function to solve my issue

 

I used = CALCULATE(SUM('3'[# of Assets(total)]),FILTER('3', [Manager ID] = EARLIER('3'[UserID])))

 

Thanks for the help anyways,

CC