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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Converting State Abbreviations

Hey guys, 

 

I have a column that looks like this:

 

State

AL

Alabama

TN

Tennessee

AL

AL

VA 

VA

Alabama

Virgina

Tennessee

 

How do I create one column that has the full name for every state?

1 ACCEPTED SOLUTION
chethan
Resolver III
Resolver III

@Anonymous

 

Import the data from http://www.stateabbreviations.us/ via Web 

 

& go Edit Queries  use > Home Tab > Merge Queries  

 

 

    #"Added Conditional Column" = Table.AddColumn(#"Duplicated Column", "State", each if [state old] <> [#"state new"] then [#"State New"] else null )

 

Regards,

Chetan K

 

View solution in original post

4 REPLIES 4
chethan
Resolver III
Resolver III

@Anonymous

 

Import the data from http://www.stateabbreviations.us/ via Web 

 

& go Edit Queries  use > Home Tab > Merge Queries  

 

 

    #"Added Conditional Column" = Table.AddColumn(#"Duplicated Column", "State", each if [state old] <> [#"state new"] then [#"State New"] else null )

 

Regards,

Chetan K

 

trebgatte
Most Valuable Professional
Most Valuable Professional

You could look at the length of the value. If 2, then do a look up, else, show original value. This should be pretty easy to do in DAX.

 

Treb Gatte | MVP | TumbleRoad.com | PowerBICertification.com

 

 

As @trebgatte mentioned, you'll need to have some master lookup table for the states abbreviation and full name.  Then you can create a new calculated column that checks the length, and pulls the [StateFullName], otherwise it defaults to the existing value.

Dan Malagari
Consultant at Headspring

New to Power BI & Data:  Can you provide the formula you would use to calculate length and pull state name.  Once I see it I can make the connection to how it works.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.