cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
qwertzuiop Regular Visitor
Regular Visitor

How can I sort a dropdown-list?

Dear PowerBI-Community

 

I thought it was easy, but I don't know how.
I would like to sort this drop-down list accordingly.

Mon
Tue
Wed
...

How can I do this without affecting the rest of my modeling?

 

week.PNG

 

Thank you so much for your help!

Cheers

qwertzuiop

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How can I sort a dropdown-list?

Hi @qwertzuiop ,

 

We can create a seprate calculated table to meet your requirement:

 

SortTable = 
ADDCOLUMNS (
    DISTINCT ( 'Table'[Wochentag-kurz] ),
    "Index", SWITCH (
        'Table'[Wochentag-kurz],
        "Mo", 1,
        "Di", 2,
        "Mi", 3,
        "Do", 4,
        "Fr", 5,
        "Sa", 6,
        "So", 7,
        0
    )
)

 

Then set the name column sort by index column and create a relationship between the origin table.

1.PNG

 

2.PNG

 

Then we can use the name column in new sort table as the slicer field without changing the origin table.

3.PNG

 


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: How can I sort a dropdown-list?

@qwertzuiop You can do this in M (Power Query) or DAX in a calculated column. This post covers both options -> https://community.powerbi.com/t5/Desktop/Sort-by-Day-of-week/td-p/338758


Near SE WI? Join our PUG Milwaukee Brew City PUG
Community Support Team
Community Support Team

Re: How can I sort a dropdown-list?

Hi @qwertzuiop ,

 

We can create a seprate calculated table to meet your requirement:

 

SortTable = 
ADDCOLUMNS (
    DISTINCT ( 'Table'[Wochentag-kurz] ),
    "Index", SWITCH (
        'Table'[Wochentag-kurz],
        "Mo", 1,
        "Di", 2,
        "Mi", 3,
        "Do", 4,
        "Fr", 5,
        "Sa", 6,
        "So", 7,
        0
    )
)

 

Then set the name column sort by index column and create a relationship between the origin table.

1.PNG

 

2.PNG

 

Then we can use the name column in new sort table as the slicer field without changing the origin table.

3.PNG

 


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,399)