Forum Discussion

Fabi1208's avatar
Fabi1208
Frequent Visitor
4 years ago
Solved

Change from a date interval to single dates

Hello everyone! 😊   I have a tricky problem with my data set. In the picture below you see the date "from" and "to". This means, that the employee was e.g. sick from a specific date to a specific ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Fabi1208 ,

     

    Could you please provide some error messages to help us clarify your scenario?

     

    I tried Jakinta 's method and it worked fine on my side.

    And I think the most effective way is to use {Number.From() ..Number.From()} to get all list of dates between two dates (From and To columns)

        #"Added Custom" = Table.AddColumn(#"Changed Type with Locale", "Custom", each {Number.From([From])..Number.From([To])}),
        #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
        #"Changed Type1" = Table.TransformColumnTypes(#"Expanded Custom",{{"Custom", type date}})
    in
        #"Changed Type1"

    Output:

     

    But anyway ,glad to see your issue has been resolved !

     

    Refer to:

    https://www.youtube.com/watch?v=u3HLseZxSj4

    https://www.thepoweruser.com/2019/07/23/fill-dates-between-dates-with-power-bi-power-query/

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.