cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## SUMIF IN POWER BI

I need to sum values considering variableS in another column that are not unique. Example.

 P1 P2 TOTAL A 20 30 B 10 40 C 30 70 A 10 30 B 30 40 C 40 70

Variable "A" appears twice in the chart, column "TOTAL" needs to sum those values 20+10 and the result must repeat in every row "A" appears

1 ACCEPTED SOLUTION
Community Support

Hi @Anonymous ,

You can create column like DAX below.

`TOTAL= CALCULATE(SUM(Table1[P2]),FILTER(ALLSELECTED(Table1),Table1[P1]=EARLIER(Table1[P1])))`

Best Regards,

Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 REPLIES 4
Community Support

Hi @Anonymous ,

You can create column like DAX below.

`TOTAL= CALCULATE(SUM(Table1[P2]),FILTER(ALLSELECTED(Table1),Table1[P1]=EARLIER(Table1[P1])))`

Best Regards,

Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Resident Rockstar

@Anonymous  are you looking for this

`T:= CALCULATE(SUM('Table 1'[P2]),ALLEXCEPT('Table 1','Table 1'[P1]))`

New Animated Dashboard: Sales Calendar

Super User I

@Anonymous ,

Try this:

`Total Calculated = CALCULATE(Sum(Total[P2]),FILTER(ALLEXCEPT(Total,Total[P1]),MAX(Total[P2])))`

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

Proud to be a Super User!

Super User IV

https://community.powerbi.com/t5/Desktop/calculate-category-total-in-table-visualization/td-p/519340

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information.
Thanks.

Proud to be a Super User!

Announcements