Forum Discussion
helper column to sort legend dynamically
- Anonymous7 years ago
HI jski ,
You can consider to create a sort table with unique fields value and index fields on datasource side.
After this, you can use index column as 'sort by column as' of value field, use this value field to create relations mapping to draw table and use new table value fields as legend.(legend field sort order will changes based on index which you set up on datasource side)If you want this table only exist on power bi side, you can extract all color value from raw table and remove duplicate value, create a calculated column with switch function to define their index.(sort order will changes if you modify formula conditions)
Regards,
Xiaoxin Sheng
HI jski ,
Power bi not allow you to do customize on legend field sort order. You can refer to following link to create a custom sorting table to achieve your requirement:
Regards,
Xiaoxin Sheng
These instructions are to hardcode a sorting order and are not applicable. I need the sort to be dynamic. It seems like there should be a way to create a calculated column that can be used with changing data. Can you create a virtual table that is just a list of counts and also has logic to account for tiebreakers (due to the 'this column can't be used due to multiple values' error message)?
- Anonymous7 years agoNot applicable
HI jski ,
You can consider to create a sort table with unique fields value and index fields on datasource side.
After this, you can use index column as 'sort by column as' of value field, use this value field to create relations mapping to draw table and use new table value fields as legend.(legend field sort order will changes based on index which you set up on datasource side)If you want this table only exist on power bi side, you can extract all color value from raw table and remove duplicate value, create a calculated column with switch function to define their index.(sort order will changes if you modify formula conditions)
Regards,
Xiaoxin Sheng