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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Rkelly
New Member

Splitting column and convert data

Hi,

 

I have a data table that records the date of a particular event through two seperate fields. One records the day of the week that an event is held the other is a 53 character field that nominates which weeks the event is occuring.

 

an example of the data is 

event_id - 591683

day_of_week - 1

Weeks - NNNYYYYYYYYYNNYYYYYYYYYYYNNYYYYYYYYYYNNYYYYYYYYYYNNNN

 

the result I am looking for is a column containing event id and a column containing the date of the event.

any assistance to transform the data would be appreciated.

 

Thanks 

1 REPLY 1
ImkeF
Community Champion
Community Champion

This will return the weeknumbers in a list:

 

List.Transform(Text.PositionOf([Column1], "Y", Occurrence.All), each _+1)

 

You can use it in a custom column. When you expand it, you should have 3 columns that then can be further combined to a date (#date(YYYY, MM, DD))

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors