Forum Discussion
danman71
3 years agoRegular Visitor
Learning DAX and DAX studio
Hello All, I have this simple DAX line EVALUATE TOPN(10, VALUES(Calendar[DayName])) This column is simply Monday, Tuesday, Wednesday, etc.. and I want to change the case to uppercase. But I c...
- 3 years ago
Hi,
Please try something like below.
EVALUATE TOPN ( 10, SELECTCOLUMNS ( ADDCOLUMNS ( VALUES ( 'Calendar'[DayName] ), "@Uppercase", UPPER ( 'Calendar'[DayName] ) ), "Uppercase", [@Uppercase] ) )
Jihwan_Kim
Super User
3 years agoHi,
Please try something like below.
EVALUATE
TOPN (
10,
SELECTCOLUMNS (
ADDCOLUMNS (
VALUES ( 'Calendar'[DayName] ),
"@Uppercase", UPPER ( 'Calendar'[DayName] )
),
"Uppercase", [@Uppercase]
)
)- danman713 years agoRegular Visitor
This works, can you explain why you have to do
"@Uppercase", UPPER ( 'Calendar'[DayName] ) .. snip .. ), "Uppercase", [@uppercase]It looks like we are assiging the value of UPPER(calendar[dayname]) to the variable @uppercase, and then returning it at the end? Is that correct?
And why does the table need single ' around it within the function?
- Jihwan_Kim3 years ago
Super User
Hi,
Thank you for your feedback.
UPPER(Calendar[DayName]) is an expression.
VALUES () function needs a table or column, not expression.
This is why I decided to select one of table contructor functions in DAX.
I hope this helps.