Forum Discussion

NQT1711's avatar
NQT1711
Frequent Visitor
2 years ago

How to create a stacked column table from many different columns

Hi everyone,

I have the following All_reviews table:

How can I create a table like the image below from the All_reviews table?

Thank you and I loof forward to your support.

 

3 Replies

  • kriscoupe's avatar
    kriscoupe
    Icon for Solution Supplier rankSolution Supplier

    Hi NQT1711 ,

     

    Using some data prep in Power Query (or in the backend if you have access) you could achieve this by UNPIVOTING the columns you need on the x-axis. Here is a reference on how to achieve this. https://learn.microsoft.com/en-us/power-query/unpivot-column

     

    Once you've done that youll be left with a column for the x-axis with all the labels such as "GENERAL, PERFORMANCE etc." and another column with the attributes (positive, negative, neutral). You can then use a count function on a stacked bar chart with the labels on the x-axis, the count function as the values and the attribute as the legend.

     

    (Side note, from what I can see of the data when you unpivot this will cause your ID column to no longer be unique. If you are using it in any relationships on the 1 side then you may need to refactor your modelling.)

     

    Hope it helps,

    Kris

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, NQT1711 

    Depending on the data structure, the data may need to be transformed to ensure that it is formatted appropriately for visualization. This may involve grouping, summarizing, or pivoting the data, customizing the appearance and settings of the chart through panes to match the desired results. You can adjust colors, labels, titles, and more to improve readability and impact. For more details on creating and customizing column charts in Power BI, see the official documentation:

    Column charts in Power BI paginated report - Power BI | Microsoft Learn

     

    How to Get Your Question Answered Quickly 

    Best Regards

    Yongkang Hua

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.