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
67nmark
Helper I
Helper I

custom sort order across multiple columns

Hello,

 

I am using Power BI to report on survey results data. I have 10 columns with the same answer options (Yes, No, Not sure, NA). I want to set a custom sort order on all columns that use these answer options.

 

I have created a reference table with an AnswerID and AnswerText column and have created a relationship between this table and the first column with those answer options. Everything works great.

 

I start running into trouble when I try to use the same reference table on another column. I have solved the problem by copying the reference table as many times as I need it and making relationships between each reference table and the column in question.

 

So, could someone tell me if there's a recognised way to deal with this type of situation where I only need one reference table that can work across all columns?

 

Thanks in advance for any guidance.

 

Cheers,

Mark

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@67nmark,

In your scenario,  you can create the following sort columns  in your table.

sort1 = RELATED(Reference[AnswerID])
sort2 = LOOKUPVALUE(Reference[AnswerID],Reference[AnswerText],Table[Column2])
sort3 = LOOKUPVALUE(Reference[AnswerID],Reference[AnswerText],Table[Column3])
……
sort10 = LOOKUPVALUE(Reference[AnswerID],Reference[AnswerText],Table[Column10])

Then you can sort the 10 columns by using these sort columns.

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

3 REPLIES 3
Zmas
New Member

I have the same issue but with a survey of 70+ questions. Creating a new sort_order column for each question is a complete waste of time. Does anyone have any new solutions to this issue?

 

I see that this is a common issue and I am really confused as to why Microsoft doesn't simply enable manual sorting within the visual... 

v-yuezhe-msft
Employee
Employee

@67nmark,

In your scenario,  you can create the following sort columns  in your table.

sort1 = RELATED(Reference[AnswerID])
sort2 = LOOKUPVALUE(Reference[AnswerID],Reference[AnswerText],Table[Column2])
sort3 = LOOKUPVALUE(Reference[AnswerID],Reference[AnswerText],Table[Column3])
……
sort10 = LOOKUPVALUE(Reference[AnswerID],Reference[AnswerText],Table[Column10])

Then you can sort the 10 columns by using these sort columns.

Regards,
Lydia

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

Thanks Lydia,

I'm thinking it's probably easier for me to do what I've done but that's a handy answer.

Cheers,

Mark

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.