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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

slicer

I want to take the start and end value of the slicer for hour like this, i want to take start and end dynamically, how to dax query it

Amirtha_0-1682155661704.png

 

4 REPLIES 4
HassanAshas
Helper V
Helper V

You can use MIN and MAX functions for this, 

To get Min Hour Value, 

 

Min_Hour = MIN(Table[Hour])

 

To get Max value, 

 

MAX_Hour = MAX(Table[Hour])
Anonymous
Not applicable

Ok, i've done it, how to take the values other than the selected range, from 0 to that Min_hour and max_hour to 23

Do you want to take all the values, or only the Min and Max value before the Min_Hour? 

If you want to take all values in form of tables, then you can use the following, 

 

var _MinHour = MIN (Table[Hour])
var _MaxHour = MAX (Table[Hour])

_UnderMin = 
    FILTER(
        DISTINCT (ALL(Table[Hour])), 
        Table[Hour] < _MinHour
    )

_AboveMax = 
    FILTER(
        DISTINCT (ALL(Table[Hour])), 
        Table[Hour] > _MaxHour
    )

 

The _UnderMin will return you all the values below the Minimum selected value and _AboveMax will return all the values greater than the selected value. 

 

If you want the Minimum value (0), Max value below the Selected Minimum Value, Minimum value selected above the Selected Max Value (24) and the Max Value, you can use the following DAX Codes, 

 

var _MinHour = MIN (Table[Hour])
var _MaxHour = MAX (Table[Hour])

_MinHourAllValues = MIN (ALL(Table[Hour]))
_MaxHourAllValues = MAX (ALL(Table[Hour]))

_Max_Value_Below_Minimum = 
    MAXX (
        FILTER (
               ALL(Table),
                
        Table[Hour]
    )
    
_Max_Value_Below_Minimum = 
    MAXX (
        FILTER (
            DISTINCT (ALL(Table[Hour])), 
            Table[Hour] < _MinHour
        ), 
        Table[Hour]
    )
    
_Min_Value_Above_Maximum = 
    MINX (
        FILTER (
            DISTINCT (ALL(Table[Hour])), 
            Table[Hour] > _MaxHour
        ), 
        Table[Hour]
    )
Anonymous
Not applicable

I tried this, the issue I am facing is, when i try undermin in another measure to calculate exp - current, I am getting blank values cz it is taking 0 as minhour and 23 as maxhour even when i select from a range...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.