Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Sorting rows based on color codes

Hello All,

 

I have a table report where I am having agentname,department,overall tickets completed in my view.

I created a measure like below to highlight background color of the rows

 

Color = SWITCH(TRUE(),
[Overall Tickets Completed] < (sum(Query1[Avg25B])-2), "BLUE",
[Overall Tickets Completed] >= (sum(Query1[Avg25B])-2) && [Overall Tickets Completed] < (sum(Query1[Avg25L])-2), "LIGHT BLUE",
[Overall Tickets Completed] >= (sum(Query1[Avg25L])) && [Overall Tickets Completed] < (sum(Query1[Avg25Y])), "GREEN",
[Overall Tickets Completed] >= (sum(Query1[Avg25Y])) && [Overall Tickets Completed] < (sum(Query1[Avg25R])+2), "LIGHT BLUE",
"Red")
 
Now my requirement is I need to sort the rows based on colors.
Couls anyone please help on this
  • Hi, copy paste your Color measure and create Color Sort Measure assigning numbers to your colors, basically instead of your colors you will put numbers according to the sort order they have to be in the table. Then bring this Color Sort to a table, giveit a short name (one letter), sort the table by this color sort. 

     

    Minimize that column till it is hidden, not visible, put a text box with no background on top of the column names only, so noone expands it and sees it.

     

2 Replies

  • olgad's avatar
    olgad
    Resident Rockstar

    Hi, copy paste your Color measure and create Color Sort Measure assigning numbers to your colors, basically instead of your colors you will put numbers according to the sort order they have to be in the table. Then bring this Color Sort to a table, giveit a short name (one letter), sort the table by this color sort. 

     

    Minimize that column till it is hidden, not visible, put a text box with no background on top of the column names only, so noone expands it and sees it.

     

  • olgad's avatar
    olgad
    Resident Rockstar

    Anonymous Have my answer solved your problem? If so, can you please accept my answer as Solution to help other members find it faster? Thank you very much for your kind cooperation!