Forum Discussion

RickJames's avatar
RickJames
Frequent Visitor
4 years ago
Solved

Adding new rows to a table

I have table that is read in from an SQL server where  I do some calculation and renaming in Power Query and then I need to add additional rows to the table so that things will be calculated correctly.   The data is from an appointment calendar for our staff, in our application if you schedule a meeting for multiple people it saves as one record with the primary user name and then has fields for each additional person inlcuded.   I need to have a separate row/record for each person.   

 

For Example, I need this:

Meeting DateTime DurationScheduler Additional Person 1 Additional Person 2 
1/1/202210:00am30minMikeFrankSue
1/2/202211:00 AM60minJayGeorge 
      

 

To Become This:

Meeting DateTime DurationScheduler 
1/1/202210:00am30minMike
1/1/202210:00am30minFrank
1/1/202210:00am30minSue
1/2/202211:00 AM60minJay
1/2/202211:00 AM60minGeorge

 

I found this example below which makes sense, but I'm not sure how it would get incorporated into the exsiting process.  If I go to the advanced editor in power querry I don't know how to weave the code below in with what is already there.   Thanks for any help.

 

https://community.powerbi.com/t5/Desktop/Conditionally-Insert-Row/m-p/621076

  • RickJames 

    select the first 3 columns and unpivot other columns

    filter column value and remove attribute column