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

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

Reply
water-guy-5
Helper III
Helper III

Using a trim function

Hello, I have a set of data that looks like this, and want to convert this column into two seperate ones with "State" and "Status"

Alaska - Active                         
Texas - Active
Nebraska - Non Useable
Florida - Non Useable

I have already created a measure that cuts off any text past " -......" which returns me "Nebraska - Non Useable" --> "Nebraska", for example. So, my "State" column is good to go.

For my "Status" column, I have a calculated column that looks like this:


Project =
VAR _Position1 =
VALUE ( FIND ( "-", Table[State Status], 1, 0 ) )
VAR _Position2 =
IF (
_Position1 > 0,
FIND ( "-", Table[State Status], _Position1 + 1, 0 ),
0
)
RETURN
IF (
_Position1 > 0,
TRIM ( RIGHT ( Table[State Status], _Position2 + 11 ) )
)

What this does is return me only "Non Useable" (which makes sense given the "+11" which counts 11 characters from the right. What I need is some sort of additional piece of DAX that also solves for the text that needs "+6" for he values that contain "Active"
Thanks!

1 ACCEPTED SOLUTION
goncalogeraldes
Super User
Super User

Hello there! Why not perform these transformation in the Power Query Editor with the help of the "Split column by" --> "Delimiter" --> and then select "-"?

View solution in original post

1 REPLY 1
goncalogeraldes
Super User
Super User

Hello there! Why not perform these transformation in the Power Query Editor with the help of the "Split column by" --> "Delimiter" --> and then select "-"?

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.

Top Solution Authors