Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register 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?
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
77 | |
76 | |
69 | |
48 | |
40 |
User | Count |
---|---|
62 | |
41 | |
33 | |
30 | |
29 |