My requirement is to sort the order in the Stacked bar graph as shown below. As you can see in the first stacked bar graph the Medium with value 3 is on top and then Hard with value 2 is at bottom . I want this to be reversed means Hard with red color value 2 should come on top and then the Medium with value 3 should come bottom.
Here the legend is a "Calculated Column".
Thanks in advance.
Solved! Go to Solution.
I got the solution , i tried to create separate measures for hard,medium and easy and use them in Value box and arrange these measures as added so that it sorts the column charts as required.
you can change the sort order, using the "Sort by Column" button.
Create a column with the sort order for each category ...
e.g. 3 (Hard) > 2 (Medium) > 1 (Easy)
... and use these with "Sort by Column" as surrogate sort column
Here my category column is calculated one and below is the formula for it.
that should help.
Add a custom column and calculate the catorgary column.
The if expression selects between two expressions based on a logical condition.
if 2 > 1 then 2 + 2 else 1 + 1
The first expression (2 + 2) is selected if the logical expression (2 > 1) is true, and the second expression (1 + 1) is selected if it is false. The selected expression (in this case 2 + 2) is evaluated and becomes the result of the if expression (4).
Gilbert Quevauvilliers blogged this today.
Multiple conditions for a conditional column in Power Query
Visit our Community Blog for articles, guides, and information created by fellow community members.
Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.
Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!
Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications