Forum Discussion
Why does a sorting column affect DAX measures?
I have had this issue happen to me many times over the past few years and I don't understand it, so I was hoping someone else might!
Let's say I have a table of student grades:
| StudentID | Test | Description | Order Sort - From Sort Order Table |
| 1 | Test 1 | Average | 2 |
| 1 | Test 2 | Average | 2 |
| 1 | Test 2 | Average | 2 |
| 2 | Test 1 | Above Average | 1 |
| 2 | Test 2 | Average | 2 |
| 2 | Test 3 | Below Average | 3 |
| 3 | Test 1 | Average | 2 |
| 3 | Test 2 | Below Average | 3 |
| 3 | Test 3 | Below Average | 3 |
| 4 | Test 1 | Average | 2 |
| 4 | Test 2 | Average | 2 |
| 4 | Test 3 | Average | 2 |
| 5 | Test 1 | Above Average | 1 |
| 5 | Test 2 | Above Average | 1 |
| 5 | Test 3 | Above Average | 1 |
There is a relationship between the table above and this "Sort Order" table below:
| Description | Order Sort |
| Above Average | 1 |
| Average | 2 |
| Below Average | 3 |
Next, I have some measures that calculate percentages that do not involve the "Order Sort" column at all. I have charts and matrices that utilize these measures. Everything looks great. However, if I then go into the data view of the first table, select the "Description" column, and sort by the "Order Sort" column, all of my percentages in my charts/matrices change, and they are all incorrect.
I am going crazy and have given up on trying to sort since it ruins my measures!
1 Reply
- littlemojopuppy
Community Champion
afaherty can you provide a PBIX? Difficult to offer any insight without seeing some data and understanding the DAX in the measures...