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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Sorting slicer

Hello community,

 

I need help with sorting a slicer that is using a column with number and text. 

Metric_Group
1
5
20
45
100
115
A
B

F

 

I have Metric_group from 1-150 and A-S. How do I sort the number 1-150 in order? A-S should come after the numbers.

1 ACCEPTED SOLUTION
v-karpurapud
Community Support
Community Support

Hi @Anonymous 

Thank you for reaching out to the Microsoft Community Forum regarding your query.


To sort a slicer that uses a column containing both numbers and text , please follow the steps below:


1. Create a new column in Power BI using the following DAX:

   Sort_Order =

   VAR TryNum = IFERROR(VALUE('MetricTable'[Metric_Group]), BLANK())

   RETURN

    IF(

        NOT ISBLANK(TryNum),

        TryNum,

        1000 + UNICODE(UPPER('MetricTable'[Metric_Group]))

    )

 2. In Data view, select the Metric_Group column and apply Sort by Column choose the Sort_Order column then use the Metric_Group column in slicer visual.

I have also attached a snapshot and PBIX file for your reference  please review it.

vkarpurapud_0-1744374092187.png 

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank You

Microsoft Fabric Community Support!
 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@v-karpurapud  That worked!!

Thank you for your help.

v-karpurapud
Community Support
Community Support

Hi @Anonymous 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

v-karpurapud
Community Support
Community Support

Hi @Anonymous 

Thank you for reaching out to the Microsoft Community Forum regarding your query.


To sort a slicer that uses a column containing both numbers and text , please follow the steps below:


1. Create a new column in Power BI using the following DAX:

   Sort_Order =

   VAR TryNum = IFERROR(VALUE('MetricTable'[Metric_Group]), BLANK())

   RETURN

    IF(

        NOT ISBLANK(TryNum),

        TryNum,

        1000 + UNICODE(UPPER('MetricTable'[Metric_Group]))

    )

 2. In Data view, select the Metric_Group column and apply Sort by Column choose the Sort_Order column then use the Metric_Group column in slicer visual.

I have also attached a snapshot and PBIX file for your reference  please review it.

vkarpurapud_0-1744374092187.png 

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank You

Microsoft Fabric Community Support!
 

Deku
Super User
Super User

Add a extra column with distinct integers that match up with the sort order you want. Set the metric value column to be sorted by the new column

 

Sort by docs


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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