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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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