Forum Discussion

Laurence-'s avatar
Laurence-
Frequent Visitor
5 years ago
Solved

slicing data by time

Hi, I'm aware that slicers don't seem to support below "day" level there's an idea for implementing this here . I have related tables that hold students attending events (student is mapped to a modu...
  • v-robertq-msft's avatar
    v-robertq-msft
    5 years ago

    Hi, Laurence- 

    You can try to use the TIME() function to transform the max value of your time slicer, try a measure like this:

    Numtotal = var _min=TIMEVALUE(MINX(ALLSELECTED('Time'),[Time]))
    var _max=TIMEVALUE(MAXX(ALLSELECTED('Time'),[Time]))
    var _max1=TIME(Hour(_max),0,0)
    return
    CALCULATE(COUNTROWS('uor_pbi-stumodules'),ALLSELECTED('uor_pbi-stumodules'),VALUES('uor_pbi-stumodules'[StudentId]),FILTER(('Events'),[Start Time]>=_min&&[End Time]<=_max1))

    More info about time() function in DAX

     

    Best Regards,

    Community Support Team _Robert Qin

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.