I had a column which had the categories and another column which had the category order. My first step was to sort the category column by the category order column. I did this by selecting the category column, this opened up the Column Tools in my ribbon --> Sort by column and then selected the category order. (You will only see the columns present inside the table of the selected field). Then create your visual and then click on the 3 dots at the top right corner of the visual. --> Sort axis --> category column. This sorted my visual correctly.