Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
 
tbj2009_0-1654951787049.png

my chart selections are follows

 

tbj2009_1-1654951811662.png

can someone please help?

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

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 !

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

thanks so much!

speedramps
Super User
Super User

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 !

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.