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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors