Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

SWITCH function based ranges showing chart legend in different order

HI gurus

I am new to PowerBI but thanks to this amazing community I think I am learning very fast. 

I just got into a problem now and I cant find an answer for this

 

I have a column function as below (thanks to this community)

I am actually trying to create different ranges of price points by different brands in the dataset

 

RangeJudge = SWITCH(TRUE(),Table2[PPU]<=5.59&&Table2[PPU]<5.59,"AED 0-5",Table2[PPU]>5.59&&Table2[PPU]<=10.59,"AED 6-10",Table2[PPU]>10.59&&Table2[PPU]<=15.59,"AED 11-16",Table2[PPU]>15.59&&Table2[PPU]<=20.59,"AED 16-20",Table2[PPU]>20.59&&Table2[PPU]<=25.59,"AED 21 - 25",Table2[PPU]>25.59&&Table2[PPU]<=30.59,"AED 26-30",Table2[PPU]>30.59&&Table2[PPU]<=35.59,"AED 30-35",Table2[PPU]>35.59&&Table2[PPU]<=40.59,"AED 36-40",Table2[PPU]>40.59&&Table2[PPU]<=45.59,"AED 41-45",Table2[PPU]>45.59,"AED 45 above")
 
all works well and OK however when I put the same in legends for my chart, the 2nd range i.e. AED 6-10 shows at the top for some odd reason, all other ranges are in order as in the query above
 

my chart selections are follows

 

can someone please help?

  • Hi gurus

     

    Change "AED 6-10" to "AED  6-10" or "AED 06-10"

    to prevent the 6 sort after 1,2,3,5 !

     

    I have helped you, now please help me by giving kudos.

    Click the thumbs up and accept as solution button. 

    One question per ticket please. If you need to extend your request then please raise a new ticket.

    You will get a quicker response and each solver will get the kudos they deserve. Thank you !

2 Replies

  • Hi gurus

     

    Change "AED 6-10" to "AED  6-10" or "AED 06-10"

    to prevent the 6 sort after 1,2,3,5 !

     

    I have helped you, now please help me by giving kudos.

    Click the thumbs up and accept as solution button. 

    One question per ticket please. If you need to extend your request then please raise a new ticket.

    You will get a quicker response and each solver will get the kudos they deserve. Thank you !

  • Anonymous's avatar
    Anonymous
    Not applicable

    thanks so much!