March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a very simple DAX script written, however, DAX engine seems to ignore 'ORDER BY' (as per screenshot below). Any idea how to force DAX engine to take ORDER BY into consideration?
EVALUATE
SUMMARIZECOLUMNS(
'Table'[Year], 'Table'[Color],
FILTER('Table', 'Table'[Year] = "2000"),
"Sales Total", SUM('Table'[Sales]))
ORDER BY
"Sales Total" DESC
Solved! Go to Solution.
It needs to know how to handle the other columns. You should also avoid putting FILTER over an entire table, just use the VALUES in the column(s) you want to filter.
EVALUATE
SUMMARIZECOLUMNS (
'Table'[Year],
'Table'[Color],
FILTER ( VALUES ( 'Table'[Year] ), 'Table'[Year] = 2000 ),
"Sales Total", SUM ( 'Table'[Sales] )
)
ORDER BY
"Sales Total" DESC,
'Table'[Color],
'Table'[Year]
No, you don't need to include them all every time.
https://docs.microsoft.com/en-us/dax/orderby-statement-dax
It needs to know how to handle the other columns. You should also avoid putting FILTER over an entire table, just use the VALUES in the column(s) you want to filter.
EVALUATE
SUMMARIZECOLUMNS (
'Table'[Year],
'Table'[Color],
FILTER ( VALUES ( 'Table'[Year] ), 'Table'[Year] = 2000 ),
"Sales Total", SUM ( 'Table'[Sales] )
)
ORDER BY
"Sales Total" DESC,
'Table'[Color],
'Table'[Year]
Nice example. Does it mean that for every "ORDER BY" clause, we have to explicitly mention all columns in that table?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
202 | |
137 | |
106 | |
70 | |
68 |