This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi Power BI Community!
I have this calculated column:
Recreate your calculated column as another column but instead of having the expected value you want in your SWITCH, you just put integers 1 to 5. See formula below.
You can't sort a calculated column, by the column it's derived from.
But you could make a second calculated column, and sort your original calculated column by that.
Target Data HQ Sort =
var _diff = TrackET[Aver. Note to delivery h]
return
Switch ( True() ,
_diff <= 42, 1 ,
_diff <= 48, 2 - Target Unscheduled Tool Down" ,
_diff <= 72, 3 ,
_diff <= 96, 4- Target Scheduled Tool Down",
_diff <= 196, 5- Target Tool up/Replenishment",
6
)
Then go to [Column Tools] > [Sort By Column] and sort your original calculated column, by that new column.
And probably hide that 'sort' column from your data model, so as to not confuse anyone.
@mmace1 Thanks for the reply!
But I have this error because of the second calculated column:
Is [Target Data HQ Sort] defined by [Target Data HQ]? Because you can't do that, or it'll throw the circular dependency error when you try to sort.
[Target Data HQ Sort] needs to be defined by a 3rd column that's just
TrackET[Aver. Note to delivery h]
Example I just made locally: The Switch column is defined by Original, and the Swithc Sort Column is also defined by Original. Then I can sort the Switch Column, By Switch Sort Column, fine without an error.
So your last entry is the literal number 6, while the rest are strings - i'e "5- Target...bla bla". I think that'd throw an error once you get there.
I have an example file here:
https://www.dropbox.com/s/729i58ovutw1fvv/Example.pbix?dl=0
I think probably your issue is that you're switch statement on your sort column, is still pointing to the Measure, instead of an actual column. I think you'd need a column with [Avg. Note to delivery h], then reference that column for both your SWITCH column , and your SORT column.
I don't suppose you can upload your file?
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 29 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 71 | |
| 43 | |
| 33 | |
| 24 | |
| 23 |