Forum Discussion

Anshenterprices's avatar
4 years ago
Solved

Sorting of horizontal bar visual

Hi Team, Source table  Table A   Script ID Category Relience Tata Godrej TCS Colgate 1 Equity 100 150 120 140 160 2 Comm 210 120 235 147 135   Table B ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anshenterprices ,

     

    I suggest you to create a Dimtable with column headers as "Relience","Tata","Godrej","TCS","Colgate" you need.

    Axis = 
    {"Colgate","TCS","Godrej","Tata","Relience"}

    Then create a measure to calcualte the sum of value.

    Measure = 
    SWITCH(
    MAX('Axis'[Axis]),
    "Colgate",CALCULATE(SUM('Table A'[Colgate])),
    "TCS",CALCULATE(SUM('Table A'[TCS])),
    "Godrej",CALCULATE(SUM('Table A'[Godrej])),
    "Tata",CALCULATE(SUM('Table A'[Tata])),
    "Relience",CALCULATE(SUM('Table A'[Relience]))
    )

    Create a bar chart by Axis[Axis] in Axis and [Measure] in Value, then you can sort your visual by measure.

     

    Best Regards,
    Rico Zhou

     

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