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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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]
    )
)


Microsoft MVP



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.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule 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]
    )
)


Microsoft MVP



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.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule 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.

 



Microsoft MVP



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.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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