Forum Discussion
M_K_T
2 years agoNew Member
DAX query with date parameter
Using Report Builder, I created a dataset that contains a date parameter. I need to add an order by to the DAX Query but am unsure of the correct syntax. Example is below. I need to order by 'Task'[A...
Anonymous
2 years agoNot applicable
Hi M_K_T ,
To do this. you can use the clause ORDER BYORDER BY in a DAX query. which allows you to specify the columns to be sorted and the direction of the sort
EVALUATE
SUMMARIZECOLUMNS(
'Task'[WhatId],
'Task'[Status],
'Task'[Description],
'Task'[ActivityDate],
FILTER(
VALUES('Task'[ActivityDate]),
(vFromTaskActivityDateHierarchy1ALL || 'Task'[ActivityDate] >= DATEVALUE(vFromTaskActivityDateHierarchy1) + TIMEVALUE(vFromTaskActivityDateHierarchy1)) &&
(vToTaskActivityDateHierarchy1ALL || 'Task'[ActivityDate] <= DATEVALUE(vToTaskActivityDateHierarchy1) + TIMEVALUE(vToTaskActivityDateHierarchy1))
)
)
ORDER BY 'Task'[ActivityDate] DESC
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.