Reply
Rnaval
Helper V
Helper V
Partially syndicated - Outbound

Need help with a formula to transform values in a column

Hi All -

 

I have an excel data file with a column where I need a formula to transform the values. See below, I basically want just the hostname without the domain or blanks if there is no value in the cell.

 

Here's what the data should look like before and after the transform.

 

Before                                                                                          After

TrainingPC.emd.nyct.com  (delimiter is the first period)             TrainingPC

OperatorPC2  (there is no delimiter)                                           OperatorPC2

Blank Value (cell is blank)                                                            Blank Value

 

Appreciate any help with this.

 

Thanks...Rohit

 

 

1 ACCEPTED SOLUTION

Syndicated - Outbound

= if Text.Trim(Text.From([Hostnames])) = "" then "" else Text.Upper(Text.BeforeDelimiter(Text.From([Hostnames]), "."))

View solution in original post

4 REPLIES 4
Rnaval
Helper V
Helper V

Syndicated - Outbound

Thank You...that worked quite well...

 

One more thing, how do I make the values all uppercase?

Syndicated - Outbound

= if Text.Trim(Text.From([Hostnames])) = "" then "" else Text.Upper(Text.BeforeDelimiter(Text.From([Hostnames]), "."))

Syndicated - Outbound

Hi @Rnaval ,
I wanted to check if you had the opportunity to review the information provided by @techies . Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

techies
Resolver V
Resolver V

Syndicated - Outbound

Hi @Rnaval in the power query editor, you can add this custom column

 

= if [Hostnames] = null or Text.Trim([Hostnames]) = "" then "" else Text.BeforeDelimiter([Hostnames], ".")

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)