Forum Discussion

jaipalambati's avatar
jaipalambati
Frequent Visitor
3 years ago

sort table by DAX

hi, I created a table using as follows:

 

test table = CALCULATETABLE(SELECTCOLUMNS(Table,  "Date", Table[DateKey],
"Accum", Table[Accum.],
"Daily", Table[Daily]))
 
I got the table as below: 
 
Accum    Daily     Date
0        03/12/2022 12:00:00 AM
002/12/2022 12:00:00 AM
001/12/2022 12:00:00 AM
003/12/2022 12:00:00 AM
002/12/2022 12:00:00 AM
001/12/2022 12:00:00 AM
003/12/2022 12:00:00 AM
002/12/2022 12:00:00 AM
001/12/2022 12:00:00 AM

 

But I need to sort by date in Ascending order and fix the date format (Short Date) using DAX. 

 

Desired output:

Accum Daily  Date

001/12/2022
001/12/2022
001/12/2022
002/12/2022
002/12/2022
002/12/2022
003/12/2022
003/12/2022
003/12/2022

 

please give me suggestions with DAX  only. Thanks