Forum Discussion

Moji_mook's avatar
Moji_mook
Frequent Visitor
2 years ago
Solved

Problem when want to sort graph with total bar

I have problem when I want to sort my bar chart that have total bar. 
I create this dax table 

Overall Turnover Rate by Rank = UNION( DISTINCT(ResignedStaff[Rank]),{"Total"}) <-- It return correctly

and a measure in Overall Turnover Rate by Rank 

Total Turnover Rank (%) = SWITCH(TRUE(),
            SELECTEDVALUE('Overall Turnover Rate by Rank'[Rank])="Total"
            ,CALCULATE([%Turnover],all('Overall Turnover Rate by Rank'[Rank])),[%Turnover])

It works perfectly like this


But the problems I face is I cannot sort rank as I desire. I try many way like 

When I sort with Index I have created. My total bar is lost.

 

 


  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Moji_mook 

     

    Hopefully the following method will help you with your problem.

     

    As I understand it, you have two tables, one as shown below and one data table

     

    You can try to enter the order manually, like this

     

    Merge the two tables together in Power Query

     

     

    Then select Sort by Index column in the data table in Desktop

     

    For more detailed steps, you can refer to the following link:

    Solved: Sorting a funnel chart - Microsoft Fabric Community

     

    If the problem persists, please provide detailed sample data: How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

     

    Best Regards,
    Yulia Xu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Moji_mook 

     

    Hopefully the following method will help you with your problem.

     

    As I understand it, you have two tables, one as shown below and one data table

     

    You can try to enter the order manually, like this

     

    Merge the two tables together in Power Query

     

     

    Then select Sort by Index column in the data table in Desktop

     

    For more detailed steps, you can refer to the following link:

    Solved: Sorting a funnel chart - Microsoft Fabric Community

     

    If the problem persists, please provide detailed sample data: How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

     

    Best Regards,
    Yulia Xu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.