Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Sort visual with null at last spot

Hi,

I have a bar chart with categories on the x axis, which should be sorted according to a specific order (already have column with order). This works fine, but unfortunately it can be that some products have no category number and therefore the table with the category descriptions won't find a matching description. This creates null values in the visual (which is fine), but I want to have the null at the back of the chart (right side).

Following doesn't work for me, as I don't have the nulls in the table with the category description:
https://community.powerbi.com/t5/Desktop/sort-by-ascending-values-with-non-blanks-on-top/td-p/689199

 

Thanks!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous,

    You can extract all the field values to create a new table and set 'sort order' of these values. (setting 'sort by column' property by custom order field)
    After these steps, you can build a relationship between this table and the original table, then use new table field to replace the old one on visual to enable the custom sort order.

    Custom Sorting in Power BI 

    Regards,

    Xiaoxin Sheng

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    You can extract all the field values to create a new table and set 'sort order' of these values. (setting 'sort by column' property by custom order field)
    After these steps, you can build a relationship between this table and the original table, then use new table field to replace the old one on visual to enable the custom sort order.

    Custom Sorting in Power BI 

    Regards,

    Xiaoxin Sheng