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
Anonymous
Not applicable

DAX need help for function

What should the formula in Power BI look like if you always wanted to take the first two digits and if the second digit is a minus then the third and fourth digits as you can see in the attached screenshot.Screenshot 2022-12-19 131456.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous , try this calculated column:

 

NewColumn = 
  IF(
    MID('Table'[ExistingColumn', 2, 1) = "-",
    MID('Table'[ExistingColumn', 3, 2,
    LEFT('Table'[ExistingColumn',2)
  )

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous , try this calculated column:

 

NewColumn = 
  IF(
    MID('Table'[ExistingColumn', 2, 1) = "-",
    MID('Table'[ExistingColumn', 3, 2,
    LEFT('Table'[ExistingColumn',2)
  )

 

 

Anonymous
Not applicable

@Anonymous , if my suggestion solved the problem you posted, then please mark the answer a Accept As Soultion. This helps other members that are searching for the same or similar problem know what worked.

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.