Forum Discussion

celebrindal's avatar
celebrindal
Frequent Visitor
8 years ago
Solved

one row to many rows

Hi all, not sure if the subject line is the best to describe what i'm after but figured it would be a starting point.   I've got a table that has one row for a particular ID. For that ID i have cal...
  • TomMartens's avatar
    TomMartens
    8 years ago

    Hey,

     

    I'm sorry for the late response.

     

    Here is my solution for your requirement.

    Starting with some sample data that looks like this:

     

    In Powerquery I add a custom column using this simple formula:

    {1..[no of months]}

    The curly braces in M the Powerquery language enclose/define a list, the list that will be dfined here starts with the integer value 1 and ends with value from the [no of months] the 2 dots .. indicate that a range will be created.

     

    After applying the formual above, the result should look like this:

     

    Now the function "Expand to new rows" can be used and the "final result" will look like this:

     

    Hopefully this is what you are looking for

     

    Regards

    Tom