Forum Discussion
mattross19
4 years agoRegular Visitor
Counting Delimiter Plus 1
I have a calculated column which counts the # of semicolons in a given column, but I want the calculation to add a count of 1 if there is a value greater than 0. Here is my current formula: D...
- 4 years ago
Thanks, Clay. I wasn't able to get that to work, but I did this get to:
Measure =VAR Str = SELECTEDVALUE('Table'[Column])ReturnDIVIDE(len (str) - Len (SUBSTITUTE(Str, ";","") )+1,4)
claymcooper
4 years agoResolver II
Can you wrap it in an IF statement?
IF(DIVIDE(len ('Table'[Column]) - Len (SUBSTITUTE(('Table'[Column]), ";","") ),11)>0,DIVIDE(len ('Table'[Column]) - Len (SUBSTITUTE(('Table'[Column]), ";","") ),11)+1,DIVIDE(len ('Table'[Column]) - Len (SUBSTITUTE(('Table'[Column]), ";","") ),11))