cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

SUMIF IN POWER BI

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

P1P2TOTAL
A2030
B1040
C3070
A1030
B3040
C4070

 


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
v-xicai
Community Support
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.

View solution in original post

4 REPLIES 4
v-xicai
Community Support
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.

View solution in original post

smpa01
Resident Rockstar
Resident Rockstar

@Anonymous  are you looking for this

 

Capture.PNG

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

New Animated Dashboard: Sales Calendar


Nathaniel_C
Super User I
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.
NathanielTotal 10 16 2019.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User IV
Super User IV

Please refer

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.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors