Forum Discussion
Custom Sorting in PowerBI?
- 9 years ago
You can create a table like following one and create relationship with the original table.
Then create a calculated column in original table with following formula.
Column = RELATED( Table2[ID] )
At last, select the Type column and make it sorted by above created column.
Best Regards,
Herbert
Hi guys
This solution worked great for a situation where I had months - August, September and October not displaying in the correct order in my visual.
However, I was wondering, why did my creating of a calculated column in the SAME table using the following formula not work? So within the same table, I created a calculated column:
COLUMNSORT = IF('Table1'[MONTH] = "August", 1, IF('Table1'[MONTH] = "September", 2, IF('Table'[MONTH] = "October", 3)))
And then I tried to sort MONTH using this new calculated column 'COLUMNSORT', but it displays a message 'This column cannot be sorted by a column that is directly or indirectly sorted by this column'.
Why does it display this error message? I understand the logic that it cant sort the column because this calculated column directly sorts MONTH. So then why can it do a sort off a RELATED function which brings the exact same values into the main table? Isn't it the same thing basically?
Just trying to understand the logic in the two methods.
Thanks all
Regards
Ahxl
Hi,
Although I have used my sorted column as default column to be used as a sort, Im not able to see my bar chart change the sort automatically.