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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.