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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Sorting Calculated Column

Hi All,

 

Is there a way to sort the legends here in the below order:

 

<10K , $10K-50K , $50K-100K, >$100K 

 

Himanshu_1306_0-1678852763402.png

 

P.s : I have created the calculated column for this visual.

 

Himanshu_1306_1-1678852864689.png

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

One of ways to achieve this is creating a new column for the sorting purpose.

ARR bands sort CC =
SWITCH (
    TRUE (),
    tablename[columnname] < 10000, 1,
    tablename[columnname] >= 10000
        && tablename[columnname] < 49999.99, 2,
    tablename[columnname] >= 49999.99
        && tablename[columnname] < 99999.99, 3,
    tablename[columnname] >= 100000, 4
)

 

Try to create one more calculated column like above, and sort the  [ARR bands] column by the above column.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

3 REPLIES 3
Ahmedx
Super User
Super User

write the measure like this

ARR Bands =
SWITCH(TRUE(),
VW_PBI_ARR_ACCOUNT[LOGO_PLAN_ARR] < 10000,REPT(UNICHAR(8203),4)&"<$10K",
VW_PBI_ARR_ACCOUNT[LOGO_PLAN_ARR] >= 10000 && VW_PBI_ARR_ACCOUNT[LOGO_PLAN_ARR] < 49999.99,REPT(UNICHAR(8203),3)&"$10K-50K",
VW_PBI_ARR_ACCOUNT[LOGO_PLAN_ARR] >= 49999.99 && VW_PBI_ARR_ACCOUNT[LOGOPLANARR] <= 99999.99,REPT(UNICHAR(8203),2)&"$50K-100K
VW_PBI_ARR_ACCOUNT[LOGO_PLAN_ARR] >= 100000,REPT(UNICHAR(8203),1)&">$100K")
Jihwan_Kim
Super User
Super User

Hi,

One of ways to achieve this is creating a new column for the sorting purpose.

ARR bands sort CC =
SWITCH (
    TRUE (),
    tablename[columnname] < 10000, 1,
    tablename[columnname] >= 10000
        && tablename[columnname] < 49999.99, 2,
    tablename[columnname] >= 49999.99
        && tablename[columnname] < 99999.99, 3,
    tablename[columnname] >= 100000, 4
)

 

Try to create one more calculated column like above, and sort the  [ARR bands] column by the above column.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Anonymous
Not applicable

Thanks for the help, It worked perfectly !!!

 

Regards

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors