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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Thulasiraman
Helper II
Helper II

Max of slicer month

Hi 

 

I have a slicer of months as below:

 

Apr 22

May 22

June 22

July 22

 

I have created a matrix with selecting the above months.

I want to have a dax function to get the max of the above slicer.

I get the "May 22" as the max instead of July 22 as the month column is in text.

I have created the calculated column of the above months from dates.

 

How to get the July 22 as max month.

Pls help

 

Thulasiraman

 

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @Thulasiraman 

If you just want to sort the month name in the slicer, you need to add an extra date/index column so you can sort slicer month based on that new column.

Please refer to the links below.

Sort by Month Name 

Sort one column by another column in Power BI 

 

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@Thulasiraman , In you table or date table have column in YYYYMM format

 

Month year Sort =  format([date], "YYYYMM")

 

Now Try a measure like

 

New measure =

var _max = maxx(allselected('Date') , Date[Month Year Sort])

return

maxx(filter(allselected('Date') , Date[Month Year Sort] = _max) , Date[Month Year])

 

or using date

 

New measure =

var _max = maxx(allselected('Date') , Date[Date])

return

maxx(filter(allselected('Date') , Date[Date] = _max) , Date[Month Year])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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