Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Help creating a new table from another table

Hello, 

Is there a way in which I can have a table like this

Fecha inicioFecha finalIPNombre

BeginingEndIDName
3/16/20233/16/20232337266Oscar
3/20/20233/21/20232782871Sophia
3/21/20233/22/20232264595Rachel
3/22/20233/23/20232250748Elena

 

To a simpler table like this in which each date is a different row

DateIDName
3/16/20232337266Oscar
3/20/20232782871Sophia
3/21/20232782871Sophia
3/21/20232264595Rachel
3/22/20232264595Rachel
3/22/20232250748Elena
3/23/20232250748Elena

 

 

  • pls try this

    List.Transform(
    {Number.From([Begining]) ..Number.From([End]) },
    Date.From)

4 Replies

  • Yeah - you can go to power query and un-pivot the ID and Name columns using a function like: 

    = Table.UnpivotOtherColumns(#"Changed Type1", {"ID", "Name"}, "Attribute", "Date")

    Just delete the extra column after.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Does that work also if there are more than 2 days between begining and end? so for example:

    BeginningEndIDName
    3/21/20233/23/20232811162Camila

    to something like this

    DateIDName
    3/21/20232811162Camila
    3/22/20232811162Camila
    3/23/20232811162Camila
    • Anonymous's avatar
      Anonymous
      Not applicable

      Well what worked for me from another post was this

      Tabla1 =
      var c = CALENDARAUTO()
      return
      GENERATE('Asistance', FILTER(c, [Date] >='Asistance'[Beginning] && [Date] <= 'Asistance'[End]))
  • pls try this

    List.Transform(
    {Number.From([Begining]) ..Number.From([End]) },
    Date.From)