Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Jaweed
Helper III
Helper III

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

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @Jaweed 

You can try the following steps:

Sample:

v-angzheng-msft_0-1618363955257.jpeg

Step1:Transpose column in Query Editor

v-angzheng-msft_1-1618363955261.jpeg

v-angzheng-msft_2-1618363955263.jpeg

Step2:Use First Row as Headers

v-angzheng-msft_3-1618363955265.jpeg

Step3:Merge columns

v-angzheng-msft_4-1618363955266.jpeg

v-angzheng-msft_5-1618363955266.png

Step4:User Headers as First Row and Transpose columns

v-angzheng-msft_6-1618363955267.jpeg

v-angzheng-msft_7-1618363955268.png

Step5:Duplicate columns and split columns

v-angzheng-msft_8-1618363955268.jpeg

v-angzheng-msft_9-1618363955269.jpeg

Result:

v-angzheng-msft_10-1618363955270.png

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

View solution in original post

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @Jaweed 

You can try the following steps:

Sample:

v-angzheng-msft_0-1618363955257.jpeg

Step1:Transpose column in Query Editor

v-angzheng-msft_1-1618363955261.jpeg

v-angzheng-msft_2-1618363955263.jpeg

Step2:Use First Row as Headers

v-angzheng-msft_3-1618363955265.jpeg

Step3:Merge columns

v-angzheng-msft_4-1618363955266.jpeg

v-angzheng-msft_5-1618363955266.png

Step4:User Headers as First Row and Transpose columns

v-angzheng-msft_6-1618363955267.jpeg

v-angzheng-msft_7-1618363955268.png

Step5:Duplicate columns and split columns

v-angzheng-msft_8-1618363955268.jpeg

v-angzheng-msft_9-1618363955269.jpeg

Result:

v-angzheng-msft_10-1618363955270.png

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

daxer-almighty
Solution Sage
Solution Sage

@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.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.