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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
danman71
Regular 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 can't get the correct syntax correct within DAX Studio

 

I've tried

EVALUATE TOPN(10, VALUES(UPPER(Calendar[DayName])))

which returned an error stating this can happen when a measure formual refers to a column that contains many values....

 

Not trying to do anything fancy here, just simply play around with functions. What am I missing?

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please try something like below.

 

EVALUATE
TOPN (
    10,
    SELECTCOLUMNS (
        ADDCOLUMNS (
            VALUES ( 'Calendar'[DayName] ),
            "@Uppercase", UPPER ( 'Calendar'[DayName] )
        ),
        "Uppercase", [@Uppercase]
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

Please try something like below.

 

EVALUATE
TOPN (
    10,
    SELECTCOLUMNS (
        ADDCOLUMNS (
            VALUES ( 'Calendar'[DayName] ),
            "@Uppercase", UPPER ( 'Calendar'[DayName] )
        ),
        "Uppercase", [@Uppercase]
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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?

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.

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.