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

New Column based off of first 4 of different column value

I am having an issue with creating a formula that works. 

I have a column where they values either start with"3213" or "3215" and I need a formula that gives me an output of "A" in the new column for 3213 or an output of "B" in the new column for 3215.

 

TIA for the help. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can do:

 

= Table.AddColumns(PriorStepOrTableName, {{"Indicator", each if Text.StartsWith([Item #], "3213") then "A" else "B", type text}})

 

--Nate

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

You can do:

 

= Table.AddColumns(PriorStepOrTableName, {{"Indicator", each if Text.StartsWith([Item #], "3213") then "A" else "B", type text}})

 

--Nate

Anonymous
Not applicable

Awesome, this worked. Thank you for the help!

Anonymous
Not applicable

Hpappan_0-1677186228931.png

Result would look something like this. 

 

Thanks again. 

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 Kudoed Authors