Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Stacked bar chart formatting

Hi guys,   Looking for suggestions on how to approach this, I created a stacked chart which contains similar legends but different values, i needed them to be stacked in a cronological order, for t...
  • Icey's avatar
    Icey
    6 years ago

    Hi Anonymous ,

     

    Try this:

     

    Steps:

     

    1. Add a calculated column.

     

    Legend = [Category] & [Index]

     

     

    2. Create a table to sort Category in reverse order. Or just use "enter data" to set custom order.

     

    Category = 
    VAR t =
        DISTINCT ( 'Table'[Category] )
    RETURN
        ADDCOLUMNS ( t, "Order", RANKX ( t, [Category],, DESC, DENSE ) )
    

     

     

    3. Create a measure.

     

    1 = 1

     

     

    4. Create visuals.

    • Create a Ribbion visual and change the data color manually, then turn off background.

    • Create a Treemap visual.

     

    • Create a text box and enter text "Legend".
    • Group.

     

    Best Regards,

    Icey

     

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