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.
Hi!
I have two columns, One is an index that I am trying to sort by. The other is calculated values.
Looks like this:
Column A:
Colum B:
I get the Sort by another column error that says We can't sort Column B by Column A. There can't be more than one value in Column A for the same Value in Column B.
Why would this be an issue? It is a straight list of numbers that increase by 1 each row?
0 appears twice in the second column. You can't sort that with 2 different numbers. Should 0 be the first thing in a list or the second? It would be impossible to tell if it's supposed to be sorted as both 1 and 2.
Proud to be a Super User!
I think I had the system backwards. I was thinking by selecting Column B I was sorting column B by the order of Column A.
I tried selecting Column A and sorting it by Column A and that didn't work.
I got it to work by sorting a category column instead. It was organizing the category titles alphabetically. >.<
It doesn't matter which order you select the columns in. There are repeat values in one column and different values in the other. If you're trying to impose a sort order the unique values must match. If I want to make the alphabet sort in reverse order I need this setup:
Value | SortOrder |
A | 26 |
B | 25 |
C | 24 |
D | 23 |
E | 22 |
F | 21 |
… | … |
What you have is the equivalent of this:
Value | SortOrder |
A | 26 |
B | 26 |
C | 25 |
D | 24 |
E | 23 |
F | 22 |
… | … |
Which should come first, A or B? It's impossible to tell from this. That's why you're getting that error.
The reverse would also be incorrect.
Value | SortOrder |
A | 26 |
A | 25 |
B | 24 |
C | 23 |
D | 22 |
E | 21 |
… | … |
Should A be number 26 or 25? Impossible.
Proud to be a Super User!
What was happening was that I was getting:
and
Because I had some other column with alphabetical categories that for some reason took precedence in the sort order.
The issue I was having was that I selected the numerical column and said "Sort by Index A" which was my ACDBE column. Thinking that it would work like excel and give me an alphabetically organized index in the column I selected.
What I needed to do was select the dominant column - the fruits and veggies for instance, and sort THAT by the index values instead.
The goal (and result) was to have a list in the order of:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |