Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I have a series of value ranges. I know I could enforce the proper sorting be prefacing each one by using something like 1. xxxx 2. xxxx or a. xxxxx b. xxxxx, which I don't want to do for aesthetic reasons.
Is there a way, within this formula, to enforce the same sort order in which they are written below? So, when I put them in a chart visual for example, they appear in the legend in same order as below. Or a better solution?
Solved! Go to Solution.
@Anonymous add another coloum for sort
Value Cohorts Sort = SWITCH
(TRUE(),
'AllOpps-Products'[Extended Price]<100000,1,
'AllOpps-Products'[Extended Price]<500000,2,
'AllOpps-Products'[Extended Price]<1000000,3,
'AllOpps-Products'[Extended Price]<5000000,4,
'AllOpps-Products'[Extended Price]<10000000,5,
'AllOpps-Products'[Extended Price]>=10000000,6
)
and now select Value Cohorts column, in column tool, sort it by Value Cohort Sort
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hey @Anonymous ,
it's not possible to define a sort order from within a DAX statement.
This article describes how a column can be used by another column: https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column#select-which-column-to-use-for-sorting
Regards,
Tom
@Anonymous add another coloum for sort
Value Cohorts Sort = SWITCH
(TRUE(),
'AllOpps-Products'[Extended Price]<100000,1,
'AllOpps-Products'[Extended Price]<500000,2,
'AllOpps-Products'[Extended Price]<1000000,3,
'AllOpps-Products'[Extended Price]<5000000,4,
'AllOpps-Products'[Extended Price]<10000000,5,
'AllOpps-Products'[Extended Price]>=10000000,6
)
and now select Value Cohorts column, in column tool, sort it by Value Cohort Sort
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.