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
Nanakwame
Helper II
Helper II

Dax function to categorize based on number of characters.

Hi Power query experts,

 

I have a column that contains an extension number. For instance 100, 200, 12438976, 9872177654, ###, etc.

I will like a dax function to count the number of characters and categorize into "internal" or "external". 

so the calc should be something like this. if the number of characters is greater than 10 then "internal" else "external".

Is there a function i can use to generate this logic. 

 

Thank you 

1 ACCEPTED SOLUTION
TheoC
Super User
Super User

@Nanakwame you can use the following as a measure or column:

 

Measure = IF ( LEN ( 'Table'[Column] ) > 9 , "Output 1" , "Output 2" )

 

Hope all is well mate.

 

Speak soon 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

2 REPLIES 2
Nanakwame
Helper II
Helper II

Thank you Sir. Talk to you soon

TheoC
Super User
Super User

@Nanakwame you can use the following as a measure or column:

 

Measure = IF ( LEN ( 'Table'[Column] ) > 9 , "Output 1" , "Output 2" )

 

Hope all is well mate.

 

Speak soon 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

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