Forum Discussion

mikekolba's avatar
mikekolba
Frequent Visitor
7 years ago
Solved

Assistance needed with a Measure/Query

I currently have the following measure

 

Current Revenue = CALCULATE(
SUM(Query1[Column2]),
FILTER(Query1,SEARCH("Current",Query1[Source.Name],,0)),
FILTER(Query1,Query1[Column1]="Revenue")
)
it performs a search in the source.name column for a file name that contains "current" and a further filter on another column where it looks for "revenue" and then does a calculation and sum of the value returned.
 
I need to do an idential but instead of doing a sum, i need to search in the source.name column for a file name that contains "current" and a further filter on another column where it looks for "_" and then return the value that it found which is a text value and won't be sum or math calculation.
 
How would i modify my query above to do the desired Measure?
  • mikekolba you can change like this.

     

    Current Revenue = CALCULATE(
    MAX(Query1[Column2]),
    FILTER(Query1,SEARCH("Current",Query1[Source.Name],,0)),
    FILTER(Query1,CONTAINSSTRING( Query1[ColumnToSearch], "_")
    )

1 Reply

  • mikekolba you can change like this.

     

    Current Revenue = CALCULATE(
    MAX(Query1[Column2]),
    FILTER(Query1,SEARCH("Current",Query1[Source.Name],,0)),
    FILTER(Query1,CONTAINSSTRING( Query1[ColumnToSearch], "_")
    )