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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft

 

 

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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