Forum Discussion

Veternus's avatar
Veternus
Frequent Visitor
2 years ago
Solved

Sort Legend pf Column Chart with measures as Values

Hello good people!    I have run into an issue with my graph in Power BI. I currently have a Stacked Column Chart, where there is Date on X-Axis and Measures that return values on Y-Axis. The legen...
  • Ritaf1983's avatar
    Ritaf1983
    2 years ago

    Hi Veternus 
    Your graph and text are currently sorted in the same way. However, since graphs start from the bottom and go up, the beginning and base are at the bottom (laws of construction and physics 🙂 ). On the other hand, a legend is a list, and lists of text go up to the top. Therefore, it looks reversed. So you actually want to sort the graph and the legend in reverse order. Since there is no way to do this from the graph, you can create a table with conditional formatting that matches the legend and group it with the graph.

    The steps you can apply to achieve the result :

    1. Create a disconnected table with the column of measure name and the column of sort order :

    2. Sort the names of measures by the order column :

    3. Create a measure for a circle ( like graph's marker)

    circle = UNICHAR(11044)
    4. Create a table visual with the measure name and the circle measure:

    5. Change the column name of the circle to space + apply conditional formating :

    6. Switch off the legend of the graph and group the table with the graph:

    Pbix is attached 

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