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

View all the Fabric Data Days sessions on demand. View schedule

Reply
jmoeller
New Member

Replace Text - Starts with and Ends with

I am new to Power Query/M and I am stuck.  I know what I need to do, just not how.

 

Source Text:

http://crl.security.com/1.crl
Creation Date: 2/15/2018 11:45:00 AM
Next Publish Date: 5/15/2018 12:55:00 PM
Expiration Date: 6/15/2018 1:05:00 PM

 

  I want to replace all text starting with "Creation Date:" through "Expiration Date:" with a comma so that my results look like...

 

Desired Results:

http://crl.security.com/1.crl,6/15/2018 1:05:00 PM

 

Note that the actual dates between the two will vary.

 

Any advice to get me started would be appreciate.

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

This formula shoud do:

Text.Clean(Text.BeforeDelimiter(YourText, "Creation Date")) & ", " & Text.AfterDelimiter(YourText, "Expiration Date:")

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

1 REPLY 1
ImkeF
Community Champion
Community Champion

This formula shoud do:

Text.Clean(Text.BeforeDelimiter(YourText, "Creation Date")) & ", " & Text.AfterDelimiter(YourText, "Expiration Date:")

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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