cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
67nmark Regular Visitor
Regular Visitor

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

Accepted Solutions
Moderator v-yuezhe-msft
Moderator

Re: custom sort order across multiple columns

@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

2 REPLIES 2
Moderator v-yuezhe-msft
Moderator

Re: custom sort order across multiple columns

@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

67nmark Regular Visitor
Regular Visitor

Re: custom sort order across multiple columns

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
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 309 members 3,448 guests
Please welcome our newest community members: