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
system243trd
Helper I
Helper I

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.
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
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.