Forum Discussion

tgreve4ts's avatar
tgreve4ts
Regular Visitor
6 years ago
Solved

Chart Sorting - Highest to Lowest

This is a 3-fold question ...   Using the test-data below as to which adults and kids like the various fruit (1 represents they like that fruit), my goal is to have a chart that shows which fruit i...
  • AllisonKennedy's avatar
    6 years ago
    I think all three of these items can be solved if you UNPIVOT your fruits. https://radacad.com/pivot-and-unpivot-with-power-bi

    Scroll down to the Unpivot section in that post.
    Since you have over 50 options, I would recommend you select the demographic columns (Version, Location, etc) and then UNPIVOT OTHER COLUMNS. but up to you which is easier.

    Once you have done the Unpivot in Power Query, it will be easy to put the 'Attribute' (which you will probably rename to 'Fruit' or something similar) in Axis and 'Value' in Values to get the chart you want.

    You can also then easily sort by most popular fruit/attribute/item https://docs.microsoft.com/en-us/power-bi/consumer/end-user-change-sort
  • FrankAT's avatar
    6 years ago

    Hi tgreve4ts ,

    as AllisonKennedy mentioned you must first unpivot your data (fruit columns) with Power Query. Then you can build very easy the report like this:

     

     Regards FrankAT