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
Merc100
Frequent Visitor

DAX Equivalent for Excel SUMIFS Where Lookup Field Contains Partial Text from Another Field

Morning all,

I am relatively new to DAX and have scoured the forums but not found anything that quite works in Powerpivot/Dax yet.

I am trying to sum each record where the Member No is contained within the Hierarchy string e.g. the first Member No occurs in rows 1, 10 and 12 and sums to 23, whereas the 3rd Member No only appears in Hierarchy row 3 so sums to 3.

The excel formula is: SUMIFS([Amount],[Hierarchy],"*"&[Member No]&"*")

I tried adding "ab" to rows 5 & 9 as part of the attempt using the following formula to see if I could get close and then apply the "Like/contains" bit of logic but no luck: CALCULATE(SUM(Table1[Amount]),FILTER(Table1,FIND("ab",Table1[Hierarchy],,0)<>0))

I have also tried CALCULATE(SUM(Table1[Amount]),FILTER(Table1,Table1[Member No]=EARLIER(Table1[Member No]))) as a start, also with the idea of getting close and then adding the Hierarchy element, also with no luck.

Any help would be hugely appreciated! Hopefully the description is understandable. Thank you in advance.

 

Capture.PNG

1 ACCEPTED SOLUTION
nandukrishnavs
Community Champion
Community Champion

@Merc100 

 

Try below DAX in the calculated column.

Column =
SUMX (
    FILTER (
        ALL ( 'Table' ),
        PATHCONTAINS ( 'Table'[Hierarchy], EARLIER ( 'Table'[Member No] ) )
    ),
    'Table'[Amount]
)



Regards,
Nandu Krishna

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 👍

Proud to be a Super User!

 


Regards,
Nandu Krishna

View solution in original post

4 REPLIES 4
nandukrishnavs
Community Champion
Community Champion

@Merc100 

 

Try below DAX in the calculated column.

Column =
SUMX (
    FILTER (
        ALL ( 'Table' ),
        PATHCONTAINS ( 'Table'[Hierarchy], EARLIER ( 'Table'[Member No] ) )
    ),
    'Table'[Amount]
)



Regards,
Nandu Krishna

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 👍

Proud to be a Super User!

 


Regards,
Nandu Krishna

Thank you Nandu, that worked perfectly!

amitchandak
Super User
Super User

@Merc100 , this should have worked

CALCULATE(SUM(Table1[Amount]),FILTER(Table1,FIND("ab",Table1[Hierarchy],,0)<>0))

 

Try this too

CALCULATE(SUM(Table1[Amount]),FILTER(Table1,search("ab",Table1[Hierarchy],,0)>0))

 

if not.

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for taking the time to look @amitchandak - much appreciated

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.