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.
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:
Type | Amount |
A | 10 |
B | 50 |
C | 72 |
A | 65 |
D | 75 |
W | 30 |
B | 29 |
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 🙂
Solved! Go to Solution.
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.
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.
Thank you Ashish, it works! 😄
You are welcome.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |