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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Data Sort

Hi All
I have data like
 
Employe
Product
A
ABC
A
PQR
A
STR
B
ABC
B
PQR
B
STR
 
In  this case, Employee will in Slicer and Product wll shown in table. Requirement is that when the user select Emp=A then output should be PQR, STR, ABC... Value Order should be like this.
And, when user select Emp=B then output should be STR, ABC, PQR..... Values should be like this.
 
I need to show the output in table
&nbsp
Please suggest how i can achieve the same
7 REPLIES 7
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

If you only have the [Employe] column and the [Product] column, it's impossible to sort the [Product] column.

But if you have a [Index] column like this, you can achieve it:

h1.PNG

Index = 
IF(
    [Employe] = "A",
    SWITCH(
        [Product],
        "PQR", 1,
        "STR", 2,
        "ABC", 3
    ),
    IF(
        [Employe] = "B",
        SWITCH(
            [Product],
            "STR", 1,
            "ABC", 2,
            "PQR", 3
        )
    )
) 

h2.PNG

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Create a new measure using concatenatex

https://docs.microsoft.com/en-us/dax/concatenatex-function-dax

 

measure = concatenatex(table,table[product])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  Thanks for your response. Can you please brief. After use concatenatex function, then how I can get my ouput,

 

Should I use SortByColumn.. Or how I can use this function

 

Kind Regards

Ashwani

@Anonymous , Is your issue resolved with above solutions?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak

Actually, i need the sorting on multiple columns. I have created manually columns.

I have created a column manually but not able to sort as its giving error that you have different values.

Is there any way to sort wuth DAX function. Or is there any way to achieve the same

Hi @Anonymous ,

 

"Is there any way to sort wuth DAX function. "

This function does exist, but you want to sort the text columns, which is not possible.

RANKX() 

 

"Or is there any way to achieve the same "

Only add [Index] column manually.

 

Add the [Index] column at the end, and then shrink the table to cover it😂.

n19.PNG

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

I was assuming you need a comma-separated list. So this will give you. You can show it on Card, table.

 

Once you filter you will only get for that employee. If you need value row-wise, then filter and table display will do.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors