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

SUM - Multiple categories

Hi All,

 

I'm new to Power BI and wondering if you can help me with this sum function. I have a table like this:

 

TEST_TABLE:

TypeAmount
A10
B50
C72
A65
D75
W30
B29

 

I want to have a sum of all amounts with either Type A or Type B.

 

I tried this: TOTAL AMOUNT = CALCULATE(SUM(TEST_TABLE[Amount],TEST_TABLE[Type]="A")+SUM(TEST_TABLE[Amount],TEST_TABLE[Type]="B"))

 

But ran into the error: "Too many arguments were passed to the SUM function. The minimum argument count for the function is 1"

 

Thanks  🙂

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=CALCULATE(SUM(TEST_TABLE[Amount]),TEST_TABLE[Type]="A")+SUM(TEST_TABLE[Amount]),TEST_TABLE[Type]="B")

or

=calculate(SUM(TEST_TABLE[Amount]),TEST_TABLE[Type]="A"||TEST_TABLE[Type]="B")

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=CALCULATE(SUM(TEST_TABLE[Amount]),TEST_TABLE[Type]="A")+SUM(TEST_TABLE[Amount]),TEST_TABLE[Type]="B")

or

=calculate(SUM(TEST_TABLE[Amount]),TEST_TABLE[Type]="A"||TEST_TABLE[Type]="B")

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Thank you Ashish, it works! 😄

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!