Forum Discussion
Sort text by ascending and make nulls last
- 6 years ago
Hi PbiCeo ,You can do this by adding a conditional column.
I'm attaching the solved screenshots for your problem.
Step1: Add condtional column and enter the detail as shown in the screenshot.
Step2:Sort the Newly added condtional column in ascending order and its done.
Step3:Now Sort the column in ascending where the alphabets are present.
Step1
Step2
Step3
if your problem is solved then please accept this as a solution.
- 6 years ago
Hi PbiCeo ,
It wont work if you are using the direct query method.
Yes there is another way to acheive this,please follow the video link below:
https://www.youtube.com/watch?v=n_gnuFS8qoY&feature=youtu.be
Thank you
Ajinkya Kadam(Analytical specialist)
if your goal is to sort a list of strings, you could get the result without using auxiliary lists
let
Source = {"A","C","a","b","B",null,"c",null},
#"Sorted Items" = List.Sort(Source,(x,y)=>if x&y<> null then Value.Compare(x ,y) else Value.Compare(y ,x))
in
#"Sorted Items"