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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Rnaval
Helper V
Helper V

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

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

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

View solution in original post

4 REPLIES 4
Rnaval
Helper V
Helper V

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

 

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

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

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

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
Super User
Super User

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], ".")

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors