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! Learn more

Reply
Tim01425
Frequent Visitor

Power bi count MAX a character appears in a row

I want to calculate the max  of a special character appears in a row. The 2 special characters are either "/"  or " \" .

 

I would like to produce similar as below results using DAX.  

 

I have this formula but it only considers one charracter '/', and i'd like to consider both in the max count.

 

MaxPathCount =
MAXX(
    TableName,
    LEN(TableName[Path])  - LENSUBSTITUTE(TableName[Path]"\","") )
)
 

 

Tim01425_0-1681425488150.png

 

Thank you so much.

4 REPLIES 4
ChrisMendoza
Resident Rockstar
Resident Rockstar

@Tim01425 - This help?

Column = 
SWITCH (
    TRUE (),
    FIND ( "\", TableName[Path],, 0 ) > 0, LEN ( TableName[Path] ) - LEN ( SUBSTITUTE ( TableName[Path], "\", "" ) ),
    FIND ( "/", TableName[Path],, 0 ) > 0, LEN ( TableName[Path] ) - LEN ( SUBSTITUTE ( TableName[Path], "/", "" ) ),
    BLANK ()
)

 image.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



@Tim01425 - Also as a measure:

image.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Thank you so much for your hepl.

 

Is there a way to have a maximum betweem all rows? in this case it should be 8?

@Tim01425 - DAX Fridays #200: Calculate the MAX of a measure - YouTube






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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