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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Honne2021
Helper II
Helper II

How do I extract multiple dates in one cell using power query or dax?

How do I extract multiple dates in one cell using power query or dax? I had tried it via Split column delimeter / or - but it only extracted the first date. See table below for the example

Employee IDTitleNameLeavesTotal Leaves ConsumedTotal Remaining Leaves
1111StaffKim Ho01/05/2021 - 1 Days (Kim Ho)

01/06/2021 - 1 Days (Kim Ho)

01/07/2021 - 1 Days (Kim Ho)

01/08/2021 - 1 Days (Kim Ho)
411


The result I want to get is:

Employee IDTitleNameLeavesTotal Leaves ConsumedTotal Remaining Leaves
1111StaffKim Ho01/05/2021411
1111StaffKim Ho01/06/2021411
1111StaffKim Ho01/07/2021411
1111StaffKim Ho01/08/2021411
1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

NewStep=#table(Table.ColumnNames(PreviousStepName),List.TransformMany(Table.ToRows(PreviousStepName),each List.RemoveItems(Text.Split(_{3},"#(lf)"),{null,""}),(x,y)=>List.FirstN(x,3)&{Date.From(Text.Split(y,"-"){0})}&List.Skip(x,4)))

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

NewStep=#table(Table.ColumnNames(PreviousStepName),List.TransformMany(Table.ToRows(PreviousStepName),each List.RemoveItems(Text.Split(_{3},"#(lf)"),{null,""}),(x,y)=>List.FirstN(x,3)&{Date.From(Text.Split(y,"-"){0})}&List.Skip(x,4)))

Thank you! That worked for me!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.