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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Nihed
Helper III
Helper III

Last month

Hello,

I have date table, then I create a new column call Month Name using 

Month Name = FORMAT('Date'[Date],"MMMM")

And I have Month Number for sorting this month name become a proper sorting.

It returns September. How can I make it return December? Since the max of the month is December.I want to return it always the biggest month name based on sorting on the Month Number

 

Thnak you.

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Nihed ,

If the Month Number column is of text type, the September will be the largest as you described.

vkalyjmsft_0-1648520761835.png

Change the Month Number data type to Whole number, it will be sorted numerically from smallest to largest.

vkalyjmsft_2-1648520899585.png

Best Regards,
Community Support Team _ kalyj

If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @Nihed ,

If the Month Number column is of text type, the September will be the largest as you described.

vkalyjmsft_0-1648520761835.png

Change the Month Number data type to Whole number, it will be sorted numerically from smallest to largest.

vkalyjmsft_2-1648520899585.png

Best Regards,
Community Support Team _ kalyj

If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

 

 

Anonymous
Not applicable

Hi @Nihed 
can you try this measure?
Max Month = CALCULATE( Month Name, Month Number = MAX(Month Number))

what do you mean by Month Name lease?

@Nihed . I think Aditya Suggested the month name column you created

 

a measure Like

maxx(filter(all(Date), Date[Month Number] = max(Date[Month Number])), Date[Month Name])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.