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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
nvizard
Regular Visitor

Measure to sum values in one column if another column does not contain certain text.

I am trying to create a measure that would sum the values in one column, 'Time(Days)', only if the column, 'Task', does not contain the text "leave". 

I was thinking of something along the lines of:

 

Measure = Calculate(sum(Time(Days), Filter(Table 1, Task does not contain "leave")

alternatively, I could create a measure that sums along Timedays if Task contains the text leave, another measure that sums timedays then subtract the latter from the former.

 

Any help would be much appreciated. 

 
 
 

datasetdataset

1 ACCEPTED SOLUTION
Tara_
Helper II
Helper II

Hi @nvizard ,

 

You can use this measure with the Search funtion

 

NotSumOfLeave = CALCULATE(SUM('Table'[Time (Days)]),
      FILTER('Table', NOT(SEARCH("leave", 'Table'[Task],,0))))
 
ttt.jpg
 
Here is a link with more options and explanations
 
Hope this helps,
Tara

View solution in original post

2 REPLIES 2
Tara_
Helper II
Helper II

Hi @nvizard ,

 

You can use this measure with the Search funtion

 

NotSumOfLeave = CALCULATE(SUM('Table'[Time (Days)]),
      FILTER('Table', NOT(SEARCH("leave", 'Table'[Task],,0))))
 
ttt.jpg
 
Here is a link with more options and explanations
 
Hope this helps,
Tara
Gordonlilj
Solution Sage
Solution Sage

Hi,

 

Perhaps something like below could work

Measure = 
CALCULATE(
  SUM('Table'[Days]),
  FILTER('Table',NOT(FIND("Leave",'Table'[Task],,0))))

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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