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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Giving a value to a word

I would like to add a new column that gives a number corresponding to a word that appears in a different column. 

 

If word APPROVED is in column 1, then "1" is shown in the new column

If word NOT APPROVED is in column 1, then "2" in the new column

If word IN PROGRESS is in column 1, then "3" in the new column

 

Thanks! 

1 ACCEPTED SOLUTION

Did you try to add a new column or a measure?

 

test this for adding a new column with DAX:

New Column = 
SWITCH([column 1],
"APPROVED ",1,
"NOT APPROVED",2,
"IN PROGRESS",3
)

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

 

LinkedIn | Twitter | Blog | YouTube 

View solution in original post

3 REPLIES 3
VahidDM
Super User
Super User

Hi @Anonymous 

 

Try this to add a new column:
New Column = 
SWITCH(EARLIER([column 1]),
"APPROVED ",1,
"NOT APPROVED",2,
"IN PROGRESS",3
)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 


              

Anonymous
Not applicable

@VahidDM That doesn't seem to work. It doesn't allow me to enter column 1 after EARLIER

Did you try to add a new column or a measure?

 

test this for adding a new column with DAX:

New Column = 
SWITCH([column 1],
"APPROVED ",1,
"NOT APPROVED",2,
"IN PROGRESS",3
)

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

 

LinkedIn | Twitter | Blog | YouTube 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.