Forum Discussion

gauravnarchal's avatar
gauravnarchal
Post Prodigy
4 years ago
Solved

Stacked Graph Order

Hello - I have created a stacked column chart as shown in the below image.

 

I want my bars to be ordered as

 

  1. Delighted
  2. Very Satisfied
  3. Satisfied
  4. Dissatisfied

Is there a way to sort the order?

 

Thank you

 

Data

 

ReadingWritingSpeakingCoaching
DelightedDelightedDelightedDelighted
DelightedDelightedDelightedDelighted
DissatisfiedDelightedDelightedDelighted
DissatisfiedDelightedDelightedDelighted
DelightedDelightedDelightedDelighted
DelightedDelightedDelightedDelighted
DelightedDelightedDelightedDelighted
DissatisfiedDissatisfiedDissatisfiedVery Satisfied
DelightedDelightedDelightedDelighted
DelightedDelightedDelightedDelighted
SatisfiedSatisfiedSatisfiedSatisfied
Very SatisfiedVery SatisfiedVery SatisfiedVery Satisfied
DelightedDelightedDelightedDelighted
SatisfiedSatisfiedSatisfiedSatisfied
DelightedDelightedDelightedDelighted
DelightedDelightedDelightedDelighted
DelightedDelightedDelightedDelighted
DelightedVery SatisfiedVery SatisfiedVery Satisfied

 

 

 

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi username,

     

     

     

    Create four measures.

     

     

    coach = DIVIDE(COUNTROWS(FILTER(ALL('Table'),'Table'[Coaching]=SELECTEDVALUE('Table'[Coaching]))),COUNTROWS(ALL('Table')))
    read = DIVIDE(COUNTROWS(FILTER(ALL('Table'),[Reading]=SELECTEDVALUE('Table'[Reading]))),COUNTROWS(ALL('Table')))
    speak = DIVIDE(COUNTROWS(FILTER(ALL('Table'),'Table'[Speaking]=SELECTEDVALUE('Table'[Speaking]))),COUNTROWS(ALL('Table')))
    write = DIVIDE(COUNTROWS(FILTER(ALL('Table'),[Writing]=SELECTEDVALUE('Table'[Writing]))),COUNTROWS(ALL('Table')))

     

     

    In Power BI Desktop, select the Clustered Column Chart.

    Setting data colors.

    Best Regards

    Community Support Team _ polly

     

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

3 Replies

  • gauravnarchal 

    It is always a good approach to organize your data in unpivoted layout, You can unpivot the columns into rows and add a sort column based on the desired order, then use it for sorting.

     

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Super User

      Hi,

      In the Query Editor, first unpivot your dataset and then specify the sort order (using Sort by column).

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi username,

     

     

     

    Create four measures.

     

     

    coach = DIVIDE(COUNTROWS(FILTER(ALL('Table'),'Table'[Coaching]=SELECTEDVALUE('Table'[Coaching]))),COUNTROWS(ALL('Table')))
    read = DIVIDE(COUNTROWS(FILTER(ALL('Table'),[Reading]=SELECTEDVALUE('Table'[Reading]))),COUNTROWS(ALL('Table')))
    speak = DIVIDE(COUNTROWS(FILTER(ALL('Table'),'Table'[Speaking]=SELECTEDVALUE('Table'[Speaking]))),COUNTROWS(ALL('Table')))
    write = DIVIDE(COUNTROWS(FILTER(ALL('Table'),[Writing]=SELECTEDVALUE('Table'[Writing]))),COUNTROWS(ALL('Table')))

     

     

    In Power BI Desktop, select the Clustered Column Chart.

    Setting data colors.

    Best Regards

    Community Support Team _ polly

     

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