Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Sorting in stacked bar chart is NOT consistent based on different Measure selected

Hi All,   I have 2 different Measure to sort the Stacked Bar Chart.   Measure 1 =  var _FYyear = SELECTEDVALUE(YEAR) return CALCULATE(                   ( SUM(Column1) - SUM(Column 2 ) , FIL...
  • v-kelly-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    As tested here,in clustered bar chart,it cant be sorted by value,so I suppose it should be just a coincidence for measure 2 to be sorted after calculation:

    For clustered bar chart,there is no selection for the visual to be ordered by a required order.

    Here,I will show you a workaround.

    Create a calculated column to rank the value:

     

    Column 2 = RANKX('Table','Table'[Consumption]-'Table'[Index],'Table'[Consumption]-'Table'[Index],DESC)

     

    Then put the column in the X- axis and choose "Expand all down one level in the hierararchy"

    Then you will see:

    For the related .pbix file,pls click here.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!