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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
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.