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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

SumX when a column contains a word

Hello, 

 

I currently have this formula: 

 

Cleaning supplies = SUMX ( FILTER( CALCULATETABLE ('D1 - GL Data'),'D1 - GL Data'[Account]="CLEANING SUPPLIES"),'D1 - GL Data'[Actual])
 
This provides me the sum of the values in the GL Data Actual column when the value in the GL Data Account column is "CLEANING SUPPLIES". Works great! However, I want to change it to includes cleaning so it would sum the GL Data Actual column when just the word cleaning is in the GL Data account column. So it could be cleaning supplies, could be cleaning tools, etc. 
 
Thanks!
 
Mike
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

This measure works fine for me

 

=SUMX(FILTER(SUMMARIZE(VALUES(Data[Account]),Data[Account],"ABCD",SEARCH("Cleaning",[Account],1,-1),"EFGH",SUM(Data[Actual])),[ABCD]>0),[EFGH])

 

Hope this helps.

 

Untitled.pngUntitled1.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

 

This measure works fine for me

 

=SUMX(FILTER(SUMMARIZE(VALUES(Data[Account]),Data[Account],"ABCD",SEARCH("Cleaning",[Account],1,-1),"EFGH",SUM(Data[Actual])),[ABCD]>0),[EFGH])

 

Hope this helps.

 

Untitled.pngUntitled1.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors