Forum Discussion

David283's avatar
David283
Helper I
3 years ago
Solved

Error pivoting column.

Hello. New to Power Query and Power BI.  Trying to learn how to pivot and unpivot to arange my columns in a way that will display well.  Google has gotten me far, but I could use some help with this ...
  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    3 years ago

    Q. And was it important to change the type to number for the value column? I wont be able to do that with my data set - Not needed.

    When you are pivoting a table, you need to provide a column on the basis of which it can evenly distribute columns (most of time, you will have this kind of column in your data. But you don't have one such column in your data). Since you wanted to have two columns in pivot, hence I had to provide an identifier which provides a sequence 1,1,2,2,3,3,4,4,5,5 and so on.

    So first row contains two columns pertaining to 1,1

    Second row for 2,2 and so on..

    When you do this then you won't encounter the issue of enough elements in the enumeration.

    Purpose of #"Added Index" and #"Divided Column" together is to provide this series.

    👍 It's been a pleasure to help you | Help Hours: 11 AM to 9 PM (UTC+05:30)

    How to get your questions answered quickly -- How to provide sample data