Forum Discussion

danielbacher's avatar
danielbacher
Frequent Visitor
2 years ago

Transposing data from excel

I have a problem with a very difficult dataset. This dataset has year written over 4 columns and all the values are therefore written after as four different columns. (See Screenshot)
"Nyeste år" = Newest Year, and the -1, -2, -3 is years back.
Every row is one company's data.

I don't see a way to work with this setup in Power BI and can't figure out if there is a way to transpose some of the columns.

My goal is to have 4 rows for every company (1 row for each year) so the values are setup by rows and not columns.
Is there even a way to do this?

6 Replies

  • dufoq3's avatar
    dufoq3
    Community Champion

    Hi, it is possible, but you have to provide sample data in usable format - not as a screenshot (if you don't know how - read my note below this post) and also expected result based on sample data.

     

    At the beginning I've created some query for you (both files attached - just replace addres in Source step).

     

    Before

     

    After

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi danielbacher ,

       

      Did dufoq3's answer help? If so please help mark it as a solution, this time increase the weight when searching for similar questions, thus helping more people, thanks~

       

      Best Regards,
      Gao

      Community Support Team

    • danielbacher's avatar
      danielbacher
      Frequent Visitor

      Yes sry for the late respons. Here is an example file from the dataset I'm working on, with expected result.
      https://fld365-my.sharepoint.com/:x:/g/personal/daniel_fld_dk/EYfXvXdoiUFNknz_FRR7OVEB4vC-t0VekYo93sYSHWWpvA?e=Tal5A3 
      The problem I'm having is I have to transpose some of the columns, but not all of them. The columns that should not be transposed doesn't matter if the values in them are duplicated to all rows for each company or they are a single value with the rest of the years blank.
      I only have to transpose the years and all the values after that.

      • dufoq3's avatar
        dufoq3
        Community Champion

        Make the link public