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

DAX function that acts as SUMIF

Hello,

 

I want to create a column in one table that first checks to see if two values match, and thens Sums the corresponding values in the new column.  In this case I would be checking to see if the counties match, and then summing the corresponding values. 

 

Here are the two tables I am working with. 

Screenshot (2).pngScreenshot (5).png

 

So in the end I want to Match CountyS with county Name, and then sum the values from WP_Plant into a new column matching the respective county. Any help would be greatly appreciated. Thank you.

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @Anonymous 

I assume you want to add the colmn to the second table?  If they are joined from 'Table1'[County Name] to 'Table2'[CountyS] the you can do by adding a column in Table 2 with this measure.

CALCULATE( SUM ( Table1[WP_Plant] ), RELATEDTABLE( Table1 ) )

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

Hello @Anonymous 

I assume you want to add the colmn to the second table?  If they are joined from 'Table1'[County Name] to 'Table2'[CountyS] the you can do by adding a column in Table 2 with this measure.

CALCULATE( SUM ( Table1[WP_Plant] ), RELATEDTABLE( Table1 ) )
Anonymous
Not applicable

Hi @Anonymous 

Please provide the data in a way we could copy&paste it. Or attach your PBIX file.

Also, please provide the expected results.

Thanks!
A

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.