Forum Discussion

arnaudmanir's avatar
arnaudmanir
Frequent Visitor
3 years ago
Solved

Second highest date

I'm in the auto finance industry and working on a table with thousands of serial numbers, corresponding funding date and payout date (if the loan is closed), all three listed in separate columns. If ...
  • ChielFaber's avatar
    3 years ago

    You probably get the result your looking for when you use group by and an index column to get an index per group.

     

    In your use case you get an index per serial number. Look at Radacad's explanation on how to do this;

    https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query

     

    After this step you can use the if function to fill the columns. For example

     

    If index = 1 then initial‐funding date else null

     

    Second funding date column will be

     

    If index = 2 the initialfundingdate else null