Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Creating stacked bar chart with excel table and wanting to filter by multiple columns

So I have two tables that show our monthly supply of inventory. We have two categories: New Construction and All Construction

 

The left table is New Const. and the right table is All Const. 

 

This is the chart I have created. The issue I am have is I want to have a slicer that consists of all the price ranges that are the column headers. So basically I want the price range slicer to show the appropriate value when selected. I'm not sure if I need to edit the entire table in power query or not. Thanks in advance! 

3 Replies

  • rubayatyasmin's avatar
    rubayatyasmin
    Community Champion

    Hi, Anonymous 

     

    the best approach is typically to unpivot your data to transform your column headers into row values.

     

    Table should look like 

     

    Type Price Range Value

    New Construction0-100K10
    New Construction100K-200K15
    New Construction200K-300K20
    All Construction0-100K5
    All Construction100K-200K10

    All Construction

    200K-300K15

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Will I be able to put the months on x-axis by doing that? I don't want to input any data because the excel spreadsheet will continuously be update. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        Unpivot your data does not affect the refresh of your data. Unpivot is a feature in Power Query that also doesn't enter new data. In Power Query, you can transform columns into attribute-value pairs, where columns become rows. More details refer to

        Unpivot columns - Power Query | Microsoft Learn

         

        Best Regards,

        Stephen Tao

         

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