Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
bryansar22
New Member

Sumif based on another table

Hello! I am trying to create a calculated column that will sum the matching data from another table.

Here's an overview:

 

Table 1 looks like this:

NameValue
Jones 15
Jones 28
X Jones1
Adams 33
Adams 44
XYZ Adams9

 

I want Table 2 to look like this (currently only has the Last column):

LastNEW CALC COLUMN
Jones=sums all Value rows containing "Jones" from Table1
Adams=sums all Value rows containing "Jones" from Table1

 

 

I want each row in Table2[New Column] to look at the value in the Table2[Last] column, then sum each row in the Table1[Value] column that contains a matching Table2[Last] value in Table1[Name]. Normally this is simple in Excel, but I'm not familiar enough with Power BI to write the function myself.

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@bryansar22

 

You can use this calculated column

 

Column =
    SUM ( Table1[Value] ),
    FILTER ( Table1, SEARCH ( [Last], Table1[Name], 1, 0 ) > 0 )
)

 

 sumif.png


Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@bryansar22

 

You can use this calculated column

 

Column =
    SUM ( Table1[Value] ),
    FILTER ( Table1, SEARCH ( [Last], Table1[Name], 1, 0 ) > 0 )
)

 

 sumif.png


Regards
Zubair

Please try my custom visuals

This worked perfectly! Thank you!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.