cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
system243trd
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
Anonymous
Not applicable

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.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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.

View solution in original post

Johanno
Responsive Resident
Responsive Resident

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]))

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.