Forum Discussion

Jaweed's avatar
Jaweed
Helper III
5 years ago
Solved

Assistance ( Reposted - wrong location)

Hi everybody
 
How to transform a table in PowerBi

Hi everybody

Can Anybody assist me? I have a table in Power Bi that I uploded. Typical records are as below.

Company       Country-Deal-with

Cpy1               USA

Cpy1               France

Cpy1               Belgium

Cpy2               UK

CPy2               France

CPy3               India

CPY2               USA

 

I would like to have one record per company with different columns. I do not know if PBi can handle.

Company      Col 1     Col2         Col3                   Col-combined

Cpy1              USA      France      Belgium             USA France Belgium

Cpy2              UK        France                                UK France

Cpy3              India      USA                                  India USA

 

I would highly appreciate your help. Thanks

  • Hi, Jaweed 

    You can try the following steps:

    Sample:

    Step1:Transpose column in Query Editor

    Step2:Use First Row as Headers

    Step3:Merge columns

    Step4:User Headers as First Row and Transpose columns

    Step5:Duplicate columns and split columns

    Result:

    Finally, to change the name of the first column to what you want.

     

     

    Is this the result you want? Hope this is useful to you

    Please feel free to let me know If you have further questions

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng

2 Replies

  • Jaweed 

     

    Why would you like to do it? The format you're trying to get the data into is not correct for reports in PBI. It's, of course, easily obtained through Power Query but why the heck would you want to do it? You can easily get the matrix visual to display data like this... The column Col-combined can be obtained easily through a measure as well.

  • Hi, Jaweed 

    You can try the following steps:

    Sample:

    Step1:Transpose column in Query Editor

    Step2:Use First Row as Headers

    Step3:Merge columns

    Step4:User Headers as First Row and Transpose columns

    Step5:Duplicate columns and split columns

    Result:

    Finally, to change the name of the first column to what you want.

     

     

    Is this the result you want? Hope this is useful to you

    Please feel free to let me know If you have further questions

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng