Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe 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.
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.
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.
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?
@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 ))
User | Count |
---|---|
21 | |
20 | |
15 | |
10 | |
7 |
User | Count |
---|---|
29 | |
28 | |
12 | |
12 | |
12 |