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
ngct1112
Post Patron
Post Patron

Calculate SUM with multiple criteria

Hi All,

 

I have a complicated situation here. I got 3 tables. Is there any Measure I could find out the sum price by

1.) Filter Status as "Progress" in Table A (Result - ID: 1, 2, 7, 8, 9, 10)

2.) Sort out that appeared already in Table B & C (Result - ID: 2, 9 , 10)

3.) SUM the Pirce of ID: 2, 9, 10 (Result - Price: 35)

Table A - Master
IDPriceStatus
15.00Progress
25.00Progress
38.00Done
48.00Done
510.00Done
610.00Done
712.00Progress
812.00Progress
915.00Progress
1015.00Progress
Table B
IDPriceStatus
15.00Progress
510.00Progress
712.00Progress
812.00Progress
Table C
IDPriceStatus
38.00Progress
610.00Progress
3 ACCEPTED SOLUTIONS

@amitchandak it seems there is something missing. Would be appreciared if I could know where goes wrong.

Sum with filters.JPG

View solution in original post

Please find the attached file after signature

Measure = 
var _d = EXCEPT(EXCEPT(FILTER(TableA,TableA[Status]="Progress"),TableB),TableC)
return
sumx(_d,[Price])

View solution in original post

@ngct1112 

If there is a keyword or space, table name needs to be there in a single quote. Better you let power BI suggest you the name and you take it. Type few letter power Bi will suggest

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@ngct1112 , I did not test it. But try like

measure = 
var _d = except(except(filter(TableA,TableA[Status]="Status"),TableB),TableC)
return
sumx(_d,[Price])

@amitchandak it seems there is something missing. Would be appreciared if I could know where goes wrong.

Sum with filters.JPG

Please find the attached file after signature

Measure = 
var _d = EXCEPT(EXCEPT(FILTER(TableA,TableA[Status]="Progress"),TableB),TableC)
return
sumx(_d,[Price])

Yes, yours is working perfectly. 

I think its because I need to update mr PI version. Great thanks for your help!

@amitchandak  Sorry that I would like to a little more advice.

I found the table names in your BI, there are no apostrophe'' for Table A & B & C but all of my table includes the apostrophe'' ('Table A', 'Table B', 'Table C'), that makes the formula cannot run properly in my BI. Do you have any idea how to slove it?

@ngct1112 

If there is a keyword or space, table name needs to be there in a single quote. Better you let power BI suggest you the name and you take it. Type few letter power Bi will suggest

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.