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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
nuttybuddy
Frequent Visitor

Error when converting a month name to month number

Hi guys

I need to sort my month name in the date order and not on alphabatical order so I was trying to add a new column based on month name which will give me the month no..

 

Here is my formula..

Month_Number = Month('Table1'[month_name])

 

This is the error I get below...

A single value for column 'master renewal month' in table 'Full list' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

Please help!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nuttybuddy,

 

I don't think you can directly convert month name to number, maybe you can try to use datevalue function to transfer them to date, then use month function to get month number.

 

Sample:

MonthNum = MONTH(DATEVALUE('Table'[Month Name]&"/1")) 

1.PNG

 

BTW, it seems like you are try to input calculated column formula into a measure, right?

 

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @nuttybuddy,

 

I don't think you can directly convert month name to number, maybe you can try to use datevalue function to transfer them to date, then use month function to get month number.

 

Sample:

MonthNum = MONTH(DATEVALUE('Table'[Month Name]&"/1")) 

1.PNG

 

BTW, it seems like you are try to input calculated column formula into a measure, right?

 

Regards,

Xiaoxin Sheng

Hi @Anonymous

 

 

When i tried this function in my chart it is popping as "Cannot convert value '/1' of type Text to type Date." can you please help

 

Thanks

Vamsi

 

 

Phil_Seamark
Microsoft Employee
Microsoft Employee

HI @nuttybuddy

 

Do you have another column in the same table that is a DateTime value that matches the same month?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

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.