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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
linlab
Regular Visitor

DAX expression for a numeric range slicer

Hello,

I've selected the column month to work as a numeric range slicer. Is there any DAX expression to get the 2 values introduced in the slicer? I've tried MIN and MAX with SELECTEDVALUE but is not working. Or I've to use the slicer with parameters instead of the column? Thanks for your help.

 

linlab_0-1617005796946.png

 

4 REPLIES 4
Anonymous
Not applicable

It's very simple actually.

[The Max] = max( T[month] )
[The Min] = min( T[month] )

where T is the table the 'month' field in the slicer lives in.

Hi @Anonymous ,

As you can see in my previous message to @amitchandak, this expression also gives the max value in the table, not the value introduced in the slicer.

linlab
Regular Visitor

Hi @amitchandak 

I've tested your solution but it returns the max and min value in the table instead of the values introduced in the slicer. In this example, the month max value in the table is 9 but the value introduced in the slicer is 12 so the measure should return 12. Have you another idea?

amitchandak
Super User
Super User

@linlab , You can use MinX/MaxX

 

measure =
var _max = maxx(ALLSELECTED('Date'),'Date'[Month])
var _min = minx(ALLSELECTED('Date'),'Date'[Month])
return
calculate(countrows(Table), filter(Date, Date[Month] >=Min && 'Date'[Month] <=Max ))

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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