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

SUM Based on values in other columns


I have the following table in Power BI.

 

Amount   Status   IsStatus

10            A           C

2              B           A

40            B           B

1000        A          B

232         E            Z

 

If the value Status = A or B and Isstatus = A or B I want to sum the value.  If it does not meet these conditions then no calculation needs to be done.

1 ACCEPTED SOLUTION

Accepted Solutions
vanguripavan Regular Visitor
Regular Visitor

Re: SUM Based on values in other columns

I think, this will work for you.

 

CALCULATE(SUM(Table1[Amount]),FILTER(Table1,Table1[Status]="A" || Table1[Status]="B" && (Table1[IsStatus]="A" || Table1[IsStatus]="B")))
 
Regards,
Pavan Vanguri.
2 REPLIES 2
Highlighted
Johanno Member
Member

Re: SUM Based on values in other columns

Hi, I don't understand which values to sum but you can check the condition with a nested if:

Value = IF('Table'[Status]="A" ||'Table'[Status]="B";IF('Table'[IsStatus]="A" || 'Table'[IsStatus]="B";'Table'[Amount]))
vanguripavan Regular Visitor
Regular Visitor

Re: SUM Based on values in other columns

I think, this will work for you.

 

CALCULATE(SUM(Table1[Amount]),FILTER(Table1,Table1[Status]="A" || Table1[Status]="B" && (Table1[IsStatus]="A" || Table1[IsStatus]="B")))
 
Regards,
Pavan Vanguri.