Forum Discussion

MichaelJackpbi's avatar
10 years ago
Solved

Pivot data from excel to PowerBI

HI friends,

I have a data set with a fact file and a date file. In the fact file, i have some fields including:

T_Date, Product_id, Province_id,Amount_type, Amount,

1/2/2016, 1123,222, Target, 1998842$

1/2/2016, 1123,222, Actual, 2298446$

1/2/2016, 1123,222, GrossSales, 354000$

5/2/2016, 531,212, Target, 1998842$

.....

NoW i want to create a new table in power bi to pivot the fact file looks like:

T_Date, Product_id, Actual, Target,GrossSales

1/2/2016, 1123, 223,2298446$,1998842$,354000$

......

 

Could anyone give me the solution to do that!>

 

Thanks,

Best regards,

  • MichaelJackpbi Go to power bi desktop query editor,

     

    1. Highlight both Amount_type and Amount columns

    2. Under Transform tab click Pivot Columns

    3. Apply as shown below.

     

2 Replies

  • MattAllington's avatar
    MattAllington
    Community Champion

    You don't need to physically create a new table of data. You can just display the data this way. Add a matrix to the canvas and then add you first 2 columns to the rows and the last 3 columns into the values

  • ankitpatira's avatar
    ankitpatira
    Community Champion

    MichaelJackpbi Go to power bi desktop query editor,

     

    1. Highlight both Amount_type and Amount columns

    2. Under Transform tab click Pivot Columns

    3. Apply as shown below.