Forum Discussion
Using a Categorical Variable Parameter on Axis and Sort Reverting to Default.
hjolley maybe you want to use matrix visual for this, add two measures, one for left and one for right, put both measures in the values section, while country on the rows, and then use data bar in conditional formatting. This way you will not run into this issue and the comparison will be super easy.
Unfortunately, I prefer the look of the column charts and the real measure is a complicated % of total that already makes use of ALLEXCEPT and I haven't been able to get one that doesn't react to the filter in question that also calculates correctly.
- Anonymous1 year agoNot applicable
Thanks for the reply from parry2k , please allow me to provide another insight:
Hi, hjolleyYour approach to sorting the columns is correct, but you need to sort each column selected by your parameter. For example:
Here is my sample data:
1.I have sorted each column based on the index column:
2.Here is the final result, which I hope meets your requirements:
Please note that the columns being sorted must not contain duplicate values, as this will result in a sorting error.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- hjolley1 year agoRegular Visitor
All the categorical columns have duplicate values. I am plotting a metric against a changing categorical variable so all the values are a creation of many, many rows.
I'm not entirely sure why your PowerBI graphs don't have a default sort axis but the problem is that whatever I do it defaults back to the numeric metric like so:
Vs yours, which does not in fact have a default sort at all:
- Anonymous1 year agoNot applicable
Hi, hjolley
Thank you for your swift response.
I apologise for any confusion caused. Your sorting method differs from mine. I use the position shown in the image below:
If your sorting column contains duplicates, the corresponding index values for those rows must also be duplicated:
I recommend using my method for sorting, as it can more effectively resolve your issue.
Of course, if you have any new ideas, you are welcome to contact us.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.