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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Zaid_M93
New Member

function to return a desired output

Example.pngIn the following photo we have a naming tool that is used in a warehouse. If we took the left side of the chart it is named as (A-B-3066), and the right side (A-CD6200-6799) and both are from (Level 2) data.

 

The desired function: search the string for how many (-) there are, then return the level of the given data and to distinguish that the right side is also a level 2 data type.

 

Thanks in advance.

1 REPLY 1
v-jiascu-msft
Microsoft Employee
Microsoft Employee

@Zaid_M93

 

Hi,

 

Power BI can’t take pictures as data source. But if you had data like it in the picture below and wanted to calculate the level, this formula would help you.

The columns in red square just show the steps.

FinalFormula =

LEN ( Table1[Name] ) - LEN ( SUBSTITUTE ( Table1[Name], "-", "" ) )If orand Search orand count functions !.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.