Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
MarkH
Helper I
Helper I

EVALUATE with a different ORDER BY column

In DAX Studio, this works:

EVALUATE
ADDCOLUMNS(
            VALUES('Date'[MMMYYYY])
                    ,"Tested Measure",[Total Sales]
)

 

But is doesn't sort correctly even though, in the model, Date'[MMMYYYY] is sorted by 'Date'[MMMYYYY sort]

 

This errors:

EVALUATE
ADDCOLUMNS(
            VALUES('Date'[MMMYYYY])
                    ,"Tested Measure",[Total Sales]
)
ORDER BY
'Date'[MMMYYYY sort]

 

Error = 'A single value for the column 'Date'[MMMYYYY sort] cannot be determined....'

 

The only difference is the ORDER BY. I assume it errors because the sort column is not in the result set.

Straightforward in SQL but surely there has to be a way round this in DAX?

Please explain.

1 REPLY 1
Anonymous
Not applicable

The simplest explanation of all is that the column by which you want to sort must be included in the result set. Easy as that.

Best
D.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.