Forum Discussion

Krcmajster's avatar
Krcmajster
Helper IV
7 years ago
Solved

Clustered chart based on multiple columns

Hi, 

 

I am have encountered and issue and can't find a solution.

 

I created the following table in Power BI:

 201820192020
Headlease Rent246246246
Market Rent235240244
Sublease Rent184188 

 

And I need the following chart (made in excel):

 

I am unable to set the clusters by year (multiple columns). So I want a split on x-axis by columns and legend by rows

  • Hi Krcmajster,

     

    Please unpivot table in Query Editor mode.

     

    Then, please [Type] to X-axis and place [Year] to chart legend.

     

    Best regards,

    Yuliana Gu

4 Replies

  • HotChilli's avatar
    HotChilli
    Community Champion

    If you shape your data as 'Year', 'Headlease Rent', 'Market Rent', 'Sublease Rent'.  It will go in a clustered column chart like you want it.

    It's a small table so you can do that in Excel OR take what you already have and transpose it and add the year column. 

    Once you have the data re-shaped, pull Year into Axis and the 3 rent types into Value.

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi Krcmajster,

     

    Please unpivot table in Query Editor mode.

     

    Then, please [Type] to X-axis and place [Year] to chart legend.

     

    Best regards,

    Yuliana Gu

    • abner0's avatar
      abner0
      Frequent Visitor

      I have a large amount of data with thousands of rows that is linked to other measures and visualizations. I suppose unpivoting will affect all these data? Is there an alternative that will keep my data intact since unpivoting will cause thousands of columns?

      • HotChilli's avatar
        HotChilli
        Community Champion

        abner0   start a new post (i.e. not on this thread) and put some detail in it please.  That's your best option to get help.