Forum Discussion

DataEnth's avatar
DataEnth
Regular Visitor
11 months ago
Solved

Order dynamically in stacked bar

Hi,

 

I'm trying to sort the categories in descending order based on the total value but  "other" should always be the last one. It's too complicated for me, I tried many option but always error, please help me.

 

 

I tried 

_Sir = IF(ISBLANK(dmt_ws_windows11[sir]),"Other",dmt_ws_windows11[sir])
 
Sort_Sir = IF(isblank(dmt_ws_windows11[Sir]),2,1)
 
and I sort _Sir by Sort_Sir but it doesn't work, any solution please?

8 Replies

  • You need to create sorting column for this

  • Hi,

    Not sure how much i can help but i'd like to try.  Share the download link of the PBI file.

  • v-hjannapu's avatar
    v-hjannapu
    Community Support

    Hi DataEnth,

    Thank you  for reaching out to the Microsoft fabric community forum.

    I would also take a moment to thank Ashish_Mathur , Ritaf1983 , mh2587 , srlabhe for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

    I understood your requirement. In Power BI, direct sorting will not work when you want descending order by total and at the same time keep “Other” always at the end.

    Best way is to create one custom sort column. In that column, give rank based on totals and for “Other” keep the highest rank, so it will always stay last. Then use this column to sort your axis.

     

    If still you face any issue, please share a small sample data and your PBIX file, then we can look into it and help you fix it.

    Regards,
    Community Support Team.

    • v-hjannapu's avatar
      v-hjannapu
      Community Support

      Hi DataEnth,
      I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.

      Regards,
      Community Support Team.

      • v-hjannapu's avatar
        v-hjannapu
        Community Support

        Hi DataEnth,
        I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We are always here to support you.


        Regards,
        Community Support Team.