2

enter image description here

Hi everyone,

I have a bar chart as shown in the screenshot above. The order for first 2 bars are correct, but the order for subsequence bars in the chart are wrong. The 3rd bar should be the category of 2% - 3% and the 4th bar should be 3% - 5% etc... The correct sequence should follow the 1st column of my table below:

enter image description here

I tried the sorting option in the chart but no matter what I choose, it doesn't achieve my goal. May I know is there any way that I can use to achieve the order that I want? Any help will be greatly appreciated!

weizer
  • 1,009
  • 3
  • 16
  • 39

1 Answers1

2

Try a custom sort: *Completed based on data provided

  1. Click on 'Enter Data' under 'Home' in the table view enter image description here

  2. Create 2 columns: 1 that has the same name as the column you want to sort. 2 Order column with the custom order for these values.

  3. Enter each bar name in the [Class] column and the position you want it in, in the Order column. 1 means you want it to be first. enter image description here

  4. Select the new table and select the column that you want to custom sort. When you select it, the column tools toolbar will automatically appear.

  5. Select 'Sort by Column' under 'Column tools' and select 'Order' this will order the Class column by the numbers you have entered. enter image description here

  6. Unselected the used field that has not been custom sorted and tick the new field with the same name under TABLE 'SortOrder'.

enter image description here

After

enter image description here

aiSolutions
  • 130
  • 1
  • 7
  • Thanks for your reply, when I used your method by putting in the ordered new field into the Axis of the bar chart, it returned 100% for all my bars. The field that I used initially in Axis field is actually a column with formula : `ATRRankCategory = VAR CatVar=[Risk used] RETURN CALCULATE (VALUES ('Reference (SL Distance)'[Range]), CatVar>='Reference (SL Distance)'[Lower_Bound],CatVar<='Reference (SL Distance)'[Upper_Bound])`. This formula categorized all the % in `[Risk used]` column into different class. Any idea on what should I do? – weizer Dec 15 '21 at 01:19
  • the solution suggested earlier is still valid; add another column forcing the order, or from what I can see, if you sort by upper bound it should also do the trick? – lorenzov Dec 15 '21 at 06:12
  • Tailor the above to [Risk used] column and it will work the same way. If you need further help, consider sharing the .pbix file. – aiSolutions Dec 15 '21 at 06:53
  • Thanks for your reply! I can share the file, but I think I can't upload the file here. How to you prefer me to share the file or you prefer me to take screenshot of every table that I have? – weizer Dec 15 '21 at 15:08
  • You can send it here: theanalyticsolutions@gmail.com – aiSolutions Dec 15 '21 at 15:48
  • I already sent to the gmail, thanks again! – weizer Dec 15 '21 at 15:58