Forum Discussion

damienz's avatar
damienz
New Member
4 years ago
Solved

How to Create Multi-category Charts with legends

Hi everyone, I came across a multi-category chart visualisation where bar charts were displayed with grouping by category and with a separate legend. Is it impossible to do up a similar view within Power BI? Thanks in advance.

  • damienz's avatar
    damienz
    4 years ago

    Hello Zhang Jing,

     

    Thank you for the help. From your example, what needs to be done is to switch the Category with the Status. After some trial & error I have managed to get the view that I was looking for:

     

     

     

3 Replies

  • damienz , You need to create a color measure .

    Color Category = SWITCH(Max('Item'[Category]) ,
    "Category 1" , "Blue",
    "Category 2" , "Green",
    "Category 3" , "Gray",
    "Category 4" , "Yellow",
    "Category 5" , "Silver"
    )

     

     

    In case you have legend move that to axis - Switch of concatenate label and sort on both axis columns 

     

    Use the color measure in conditional formatting using the field value option

     

    refer the power bi part

    Tableau Vs Power BI- Chapter 4- Bar/Clustered Bar: https://youtu.be/2P5BBRN853c

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi damienz 

     

    You can put the group column in Axis field and the other legend column in Legend field on a bar chart. Is this what you want?

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

    • damienz's avatar
      damienz
      New Member

      Hello Zhang Jing,

       

      Thank you for the help. From your example, what needs to be done is to switch the Category with the Status. After some trial & error I have managed to get the view that I was looking for: