Forum Discussion
amani1980
1 year agoFrequent Visitor
Containsstring to compare two columns...
Hi, I have two tables I want to compare Series with Runs and return an output of the number of occurances of each of the strings in Runs table as a new column COUNTS. Basically in this...
- 1 year ago
Hi amani1980 ,
You can achieve your goal by writing a measure like the one below:
CountsMeasure = VAR CurrentSeries = SELECTEDVALUE(Series[Series]) RETURN SUMX( Runs, IF(CONTAINSSTRING(Runs[Runs], CurrentSeries), 1, 0) )You can either use this measure in a calculated column, as shown below, or place it next to the Series rows in the matrix visual, as demonstrated in the one below.
I have attached an example pbix file for your reference.
DataNinja777
Super User
1 year agoHi amani1980 ,
You can achieve your goal by writing a measure like the one below:
CountsMeasure =
VAR CurrentSeries = SELECTEDVALUE(Series[Series])
RETURN
SUMX(
Runs,
IF(CONTAINSSTRING(Runs[Runs], CurrentSeries), 1, 0)
)
You can either use this measure in a calculated column, as shown below, or place it next to the Series rows in the matrix visual, as demonstrated in the one below.
I have attached an example pbix file for your reference.