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
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.

smpa01
Super User
Super User

@Anonymous  are you looking for this

 

Capture.PNG

T:= CALCULATE(SUM('Table 1'[P2]),ALLEXCEPT('Table 1','Table 1'[P1]))
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Nathaniel_C
Super User
Super User

@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
Super User

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.

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.