Forum Discussion
Sort by another column not working.
- Anonymous5 years ago
Hi pborah
I build a sample table to have a test.
I think you can build two measures to achieve your goal.
In your screenshot I think Hold Time Cumulative has been impacted by the sort column.
Hold Time Block = SWITCH ( TRUE (), 'Table'[Min] <= 5, "Under 5 Minutes", 'Table'[Min] <= 8, "Under 8 Minutes", 'Table'[Min] <= 10, "Under 10 Minutes", 'Table'[Min] <= 11, "Under 11 Minutes", 'Table'[Min] <= 12, "Under 12 Minutes", 'Table'[Min] <= 13, "Under 13 Minutes", 'Table'[Min] <= 14, "Under 14 Minutes", "Over 14 Minutes" )Hold Time Sort = SWITCH ( TRUE (), 'Table'[Hold Time Block] = "Under 5 Minutes",1, 'Table'[Hold Time Block] = "Under 8 Minutes",2, 'Table'[Hold Time Block] = "Under 10 Minutes",3, 'Table'[Hold Time Block] = "Under 11 Minutes",4, 'Table'[Hold Time Block] = "Under 12 Minutes",5, 'Table'[Hold Time Block] = "Under 13 Minutes",6, 'Table'[Hold Time Block] = "Under 14 Minutes",7, 8 )Measure:
Count of Report ID = CALCULATE(COUNT('Table'[Report ID]))Report Cumulative Count = SUMX(FILTER(ALL('Table'),'Table'[Hold Time Sort]<=MAX('Table'[Hold Time Sort])),[Count of Report ID])And you can sort the visual by Report Cumulative Count column. I try to add the sort column in this viausl and let it don't summarize, and the result shows correctly.
If this reply still couldn't solve your problem, please show me your data model(Without sensitive data), and tell your calculate logic about the Cumulative column.
You can download the pbix file from this link: Sort by another column not working
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
themistoklis Anonymous no my problem still remains. I tried the last suggestion themistoklis suggested but still to no avail. Does it have anything to do with the fact that I'm using a report server compatible version of Power BI Desktop? Build is Jan 2020 and I cannot simply upgrade without putting a change request to my manager.
As a workaround, I've included the helper column in the table and renamed it to something more suitable.
Thanks.
Maybe it has to do that you are using an older version.
There is also a workaround. Add the helper column to the table... then hide it
There is not 'hide' option in PowerBI. You can do it by minimizing the column width.
Just move the curson over the line between the helper field heading and the column heading next to it. Then drag it to the left so as to completely hide it.
Make sure you have for column 'Headings' and 'Values' the word wrap set to 'off'. So as not to have the row height increased.
I hope it makes sense??
- pborah5 years agoSolution Sage
themistoklis I already partially did what you suggested, I will go ahead and hide that column in the table. I'll kudo your responses for helping me, but please don't mind if I do not accept it as a solution. Thanks very much!
- themistoklis5 years agoCommunity Champion
Thanks for the kudos pborah
The last resolution would be to share the file with us (if it doesnt contain any confidential data)