Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
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 one column by another column in Power BI
Best Regards,
Community Support Team _ Eason
@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])