Converting a tabular data layout to a matrix layout

{ 9 Comments }

Visualise a dataset from where you want to create different columns for entries which are listed down in one single column. In a scenario where the entries which have to be shown under each of these columns so created are numeric, a simple Pivot Table will sufficed. However, if entries to be shown under the columns are text entries, then a Pivot Table will not work because in the Value area section of a Pivot Table, only numbers can be displayed. If a text column is dragged to the Value area section of a Pivot Table, then a count is displayed.

To create a multi column range from an existing dataset, you may refer to my solution in this workbook.

You may watch a short video of my solution here

Leave a Comment

Your email address will not be published.

*

  • Dear Sir,
    You cannot imagine the help you gave me with this post on the Power Query. It solved a problem I have had for a long time with Pivots that could not process text. I really appreciate your sharing of this information.
    I love to learn new applications and it was a great experience.

  • Good Morning,

    I was able to get Power Query installed on my machine and tried out your solution to my question on the Microsoft Community.

    I could not get it to work. I started with a small sample from the full set.Here is the data (sheet1): https://www.dropbox.com/s/92pwrl2tkqftju9/Oto%20Resident%20SA%20entries%20NI%20June%2011.xlsx

    and here are the screenshots from when I tried it. https://www.dropbox.com/s/4nrq4itnqsj9h57/Power%20Query.docx

    If you have any ideas on what I can do, I would love to hear them.

    Many thanks,

    Lisa

    • Hi,

      Your data in column F of “reportsgenerate_aspx (1)” worksheet does not follow any pattern. Faculty mentor should be appearing in cell F22. I have not checked for further inconsistencies. I guess you will have to correct for this first.

      • Hi there,

        I understand the source data would need some formatting. However, I pulled out a sample of two records without this problem and it still did not execute.

        Thanks,

        Lisa

  • Hi
    I would like to convert table format to matrix format as below

    Item Week
    A 23
    B 24
    C 23
    D 24
    E 25
    F 25

    as below

    23 24 25
    A B E
    C D F

    Thanks

  • Hi Ashish,

    The synonym(synonym 1, synonym 2, synonym 3) and currently available(currently available 1, currently available 2, currently available 3) columns in the destination table must be dynamically generated based on the number of synonyms each conceptid has in the source table. Can you please guide me in loading the data to destination table by using power query.

    Source:

    CONCEPT ID TERMTYPE NAME CURRENTLYACTIVE

    1 SYNONYM HLI Content 2003:1 8
    1 SYNONYM Psoriasis 5
    1 SYNONYM Misspelling 2
    23 SYNONYM Clostridium 9
    23 SYNONYM Vibrio 6
    456 SYNONYM HLI ORGANIZATION 3
    456 SYNONYM Enzymes 0
    456 SYNONYM Type attribute 1
    456 SYNONYM Multisystem disorder 4

    Destination:

    CONCEPTID SYNONYM1 CURRENTLY SYNONYM2 CURRENTLY SYNONYM3
    ACTIVE 1 ACTIVE 2

    1 HLI Content 2003:1 8 Psoriasis 5 Misspelling
    23 Clostridium 9 Vibrio 6 null
    456 HLI ORGANIZATION 3 Enzymes 0 Type attribute

    CURRENTLY SYNONYM4 CURRENTLY
    ACTIVE 3 ACTIVE 4

    2 null null
    null null null
    1 Multisystem disorder 4