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! Learn more

Reply
Anonymous
Not applicable

How to display max month name selection and min month name selection from slicer?

Hi,

 

I have kept the Month name in the slicer.

Jan
Feb
March
April
May
June
July
August
September
October
November
December


Based on user selection I need to display Max Month name and Min Month name selection in visual. Example: If the user chooses March, April, May, and October. I need to display March and October in visuals. How can we achieve this?

1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@Anonymous ,

 

YOu can see the result in below screen shot for both Min and Max column.

MaxSelectedMonth =
VAR maxselected =
CALCULATE (
MAX ( Sheet1[Date1] )
)
RETURN
IF ( ISFILTERED ( Sheet1[Date1] ), maxselected )
 
MinMonth =
VAR minselected =CALCULATE (MIN(Sheet1[Date1]))
Return if(ISFILTERED(Sheet1[Date1]),minselected)
 
Capture.JPG
Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

6 REPLIES 6
SPGMat
Frequent Visitor

Syntax is incorrect:

 

measure =

var _max  = maxx(allselected(table),table[Sequence])

return

maxx(filter(table, table[Sequence]=_max),table[Month])

Tahreem24
Super User
Super User

@Anonymous ,

 

YOu can see the result in below screen shot for both Min and Max column.

MaxSelectedMonth =
VAR maxselected =
CALCULATE (
MAX ( Sheet1[Date1] )
)
RETURN
IF ( ISFILTERED ( Sheet1[Date1] ), maxselected )
 
MinMonth =
VAR minselected =CALCULATE (MIN(Sheet1[Date1]))
Return if(ISFILTERED(Sheet1[Date1]),minselected)
 
Capture.JPG
Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

I've a similar requirement where I need to filter the amount based on the MaxSelectedMonth.

Can you help me ?

Anonymous
Not applicable

Thanks for your response.

 

If I created the same in my power bi it is displaying a blank data even I selected in the slicer.  If I select Jan, Feb, and March it needs to display Jan but it is displaying blank value.

DAX: 

MaxSelectedMonth =
VAR Maxselected = CALCULATE(MAX('Date'[MonthNameLong]))
RETURN IF (ISFILTERED('Date'[MonthNameLong]),Maxselected)

 

 
Tahreem24
Super User
Super User

@Anonymous ,

 

I test below DAX and it is working fine for MAX month:

Max_Month =
VAR max_=
CALCULATE (
MAX ( Sheet1[Month] )
)
RETURN
IF ( ISFILTERED ( Sheet1[Month] ), max_ )
 
And for Min Month just replace MAX with MIN.
 
Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.
 
 
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
amitchandak
Super User
Super User

You need to create a month sequence .

The use that.

 

measure =

var _max  = maxx(allselected(table),table[Sequence])

return

maxx(filter(table[Sequence]=_max),table[Month])

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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors