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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
mattross19
Regular 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: 

DIVIDE(len ('Table'[Column]) - Len (SUBSTITUTE(('Table'[Column]), ";","") ),11)
 
Right now it's counting an example of 2 and I want to see "3" (aka adding 1). I plan to divide the delimiters count by a manual # (11 in the example above). 
 
How do I add +1 to the formula if it contains a semicolon?
1 ACCEPTED SOLUTION

Thanks, Clay. I wasn't able to get that to work, but I did this get to: 

 

Measure =
VAR Str = SELECTEDVALUE('Table'[Column])
Return
    DIVIDE(len (str) - Len (SUBSTITUTE(Str, ";","") )+1,4)

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @mattross19 

Thanks for reaching out to us.

Could you share some sample data and its expected output? thanks

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

claymcooper
Resolver II
Resolver 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))

Thanks, Clay. I wasn't able to get that to work, but I did this get to: 

 

Measure =
VAR Str = SELECTEDVALUE('Table'[Column])
Return
    DIVIDE(len (str) - Len (SUBSTITUTE(Str, ";","") )+1,4)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors