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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
sfink22
Helper I
Helper I

Sum if rows contain matching data

I'm working on a travel budget report. I have a 'Budget' table with everyone's last name in Column 1 and their alloted budget in Column 2, like this:

'Budget'

Name             Budget

Anderson       $1,000

 

In a second table I have all the 'Transactions' for the year. The transaction names contain (somewhere in the field) the last name of the related person, i.e.:

'Transactions'

Transaction                          Spend

Anderson cell phone           $100

Hotel charge Anderson       $200

 

I'm trying to create a Column 3 in the 'Budget' table that will sum Spend by Name. In other words, it will look at the Name column in the 'Budget' table, and then scan the Transaction column in the second 'Transactions' table for anything containing that Name, and sum the corresponding Spend. The above example would output this:

'Budget'

Name             Budget      Actual Spend by Name

Anderson       $1,000       $300

 

I've tried several different ways but come up with an error every time. Any help is appreciated!

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @sfink22

Try this for your new column in the 'Budget' table:

 

 

Actual Spend by Name =
CALCULATE (
    SUM ( Transactions[Spend] ),
    FILTER (
        Transactions,
        FIND ( Budget[Name], Transactions[Transaction], 1, 0 ) > 0
    )
)

 

View solution in original post

2 REPLIES 2
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @sfink22

 

SEARCH Function could be worked for you as well.

Column =
SUMX (
    FILTER (
        Transactions,
        SEARCH ( Budget[Name], Transactions[Transaction], 1, 0 ) > 0
    ),
    Transactions[Spend]
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AlB
Community Champion
Community Champion

Hi @sfink22

Try this for your new column in the 'Budget' table:

 

 

Actual Spend by Name =
CALCULATE (
    SUM ( Transactions[Spend] ),
    FILTER (
        Transactions,
        FIND ( Budget[Name], Transactions[Transaction], 1, 0 ) > 0
    )
)

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors