Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi Team,
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.
Hi ,
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.
Hi,
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
best regards
Marcus
Hi,
Here my category column is calculated one and below is the formula for it.
Hello,
Can anyone please help me with this sorting issue ?
Regards
Hi,
could you calculate the category column in Power Query (M-Code)?
Not sure how to calcuate in M-code. I am not aware of the language.
Hi,
that should help.
Add a custom column and calculate the catorgary column.
https://docs.microsoft.com/en-us/power-bi/desktop-add-custom-column
https://docs.microsoft.com/de-de/powerquery-m/power-query-m-language-specification
If expression
The if expression selects between two expressions based on a logical condition.
For example:
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
https://www.fourmoo.com/2018/11/27/multiple-conditions-for-a-conditional-column-in-power-query/
Nope i am getting the same error.
Hi ,
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.
Ops, i think now i understand the error message...
In your soultion you have more than one value in 'Sort' for the same value in 'IFCondition'.
I think your column IFCondition is part of the table 'Capability Data' and you create the Sort column in this way.
Sort = IF('Capability Data'[IFCondition]="Hard";3; IF('Capability Data'[IFCondition]="Medium";2; IF('Capability Data'[IFCondition]="Easy";1;0 )))
Cick on the 3 dots on the top right of the object:
1. Sort by (select the Measure)
2. Sort Ascending
Hi,
The is not working , it is changing the position of the x-axis.
User | Count |
---|---|
94 | |
83 | |
78 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
62 |