Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

100% Stacked Column Chart as Line Chart

Hello,

 

I need help. I am trying to create a 100% Stacked Line Chart.

Essentially, I want a 100% Stacked Column Chart but with as a Line Chart. The legend also needs to be interchangeable as I will be creating multiple visualisations.

Example Data:

Axis is Year

Legend is Category

Value is Unknown Measure?

 

Any information would be beneficial. Thanks

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the quick reply.

    I want to see the category % on a line chart

     

    Axis = Year

    Legend = Category (Red Yellow Green)

     

    YearRedYellowGreenTotal
    20162 = 50%1 = 25%1= 25%100%
    20171= 25%2 = 50%1= 25%100%
    20181= 33%1 = 33%1= 33%100%

     

    But if I slice by category, I want to see.

     

    YearRedYellowTotal
    20162 = 66%1 = 33%100%
    20171= 33%2 = 66%100%
    20181= 50%1 = 50%100%

     

    I also need to be able to change the legend to something else, so no hard coding of the categories (e.g. "Red").

    • parry2k's avatar
      parry2k
      Icon for Super User rankSuper User

      Anonymous try following measures and put % measure on line chart, with Year on x - axis and category on Legend

       

      Sum = SUM ( Line[Value] )
      
      Sum Category = CALCULATE( [Sum], ALLSELECTED(  Line[Category] ) )
      
      % = DIVIDE ( [Sum], [Sum Category] )

      In expression, change table and column name as per your data model. and change data type of % measure to %.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Ah yes, thats an easy way, but is there any way to use the Line(Category) as the legend, so I can drop in different categories using the same measure? It's this part that I cannot figure out.