Forum Discussion

rajibmahmud's avatar
rajibmahmud
Helper III
9 years ago
Solved

Formatting Uploaded Data

Hi All,

 

Currently I am getting automated sales data from a system to PowerBI in below format. However I need to transform data into a different format where Quarter will be in Column instead of rows. As rest of the data feed is in that format. Its not possible to do it in excel before data feed as the amount of data is huge, and I dont have option to deploy someone to do data clean up.


Can someone help?

 

Current format

RegionYearQuarterValue
USA2014Q1100
USA2014Q250
USA2014Q3251
USA2014Q4213
USA2015Q1155
USA2015Q2123
USA2015Q35
USA2015Q461

 

Desired format

 

RegionYearQ1Q2Q3Q4
USA201410050251213
USA2015155123561
  • Hi rajibmahmud,

     

    In the Query Editor select the Quarter column and then Pivot columns and select the Value column in the options you will get the desired result:

     

     

    Regards,

    MFelix

     

  • MFelix's avatar
    MFelix
    9 years ago

    Hi rajibmahmud,

     

    You can do this in one of two ways in the query editor:

     

    1 - Create a new column with a text like this:

    Column "TEXT" & [Column]

    Then delete the previous column and keep this

    This can be done by the column from example and it pretty easy to achieve:

     

     

    2 - Do a Replace in the specific column for the text that you want to add:

    If all your rows start with 1 you can do a replace of 1 for Text1

     

    Regards,

    MFelix

     

     

4 Replies

  • Hi rajibmahmud,

     

    In the Query Editor select the Quarter column and then Pivot columns and select the Value column in the options you will get the desired result:

     

     

    Regards,

    MFelix

     

    • rajibmahmud's avatar
      rajibmahmud
      Helper III

      Thanks a lot. MFelix

       

      Another query I have which might going to make my life easier.

       

      Is there any option to add ' infront of all text in a specific column from query editor during data load? or do a look up and replace the text of the column with new vlookup data?