Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Pivot table

I have a table which contains the columns: employee, salary, hourly, bonus, compensation. I want to create  chart which has has three columns: employee, pay type and pay. The employee column would be...
  • v-qiuyu-msft's avatar
    9 years ago

    Hi Anonymous,

     

    If I understand correctly, the table contains five columns: Employee, Salary, Hourly, Bonus, Compensation. And you want to get the table with three columns: Employee, Pay type (contains Salary, Hourly, Bonus and Compensation) and pay, right?

     

    In your scenario, you can open Query Editor, then check the Employee column, click Unpivot Other Columns. If original table columns Salary, Hourly, Bonus or Compensation is blank, there is no row for it after this operation automatically. See:

     

    1. Assume the original table is below:

     

     

    2. Use "Unpivot Other Columns" option.

     

     

     

    If I misunderstand your requirement, please share some sample data and screenshots about desired results for our analysis.

     

    Best Regards,
    Qiuyun Yu