Forum Discussion

davidm58's avatar
davidm58
Regular Visitor
3 years ago

splitting column to remove hierarchy in indented rows

HI I have a csv file with the below layout and am trying to use power query to create a new set of columns so that it looks something like the second table, so i can then merge the two columns, I've tried transposing and pivoting but nothing seems to work! Any tips appreciated, thanks

 

MP at consulting room32.60%
      Attendance5.77%
      Attendance < 20mins100.96%
      Attendance > 20mins73.08%
      Attendance > 40mins41.35%

 

MP at consulting roomMP at consulting room32.60%
MP at consulting room      Attendance5.77%
MP at consulting room      Attendance < 20mins100.96%
MP at consulting room      Attendance > 20mins73.08%
MP at consulting room      Attendance > 40mins41.35%

 

3 Replies

  • just add a column with content of "MP at consulting room" or?

    • davidm58's avatar
      davidm58
      Regular Visitor

      ah sorry, i didnt make it at all clear that the 'MP at consulting '  then changes, will update now 

  • davidm58's avatar
    davidm58
    Regular Visitor

    sorry the table has changing rows, eg: so i need the new column to change as well 

    i tried to edit the post but couldnt work out how

     

    . 

    MP at consulting room104
          Attendance6
          Attendance < 20mins105
          Attendance > 20mins76
          Attendance > 40mins43
    MP not at consulting room0
          Attendance0
          Attendance < 20mins0
          Attendance > 20mins0
          Attendance > 40mins0