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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Get Slicer values, not related table values

Hi,

 

Is it possible to extract the absolute values or range of a time slicer.

 

JordanBowering_0-1704984895953.png

 

 

e.g. for the slicer above I want to be able to extract the 13:53 to 14:53. If I use SELECTEDVALUE it will only return within the limits of the rows that meet the criteria. So if my earliest time entry is 13:57, it will return 13:57 instead of 13:53.

 

Ultimately I want to calculate the number of minutes within the time period specified for use in a measure. I considered linking the slicer to a new table to solve my issue, however my understand is that table will only be able to update on scheduled refresh and not as often as my other data which is on direct query.

 

Thanks,

Jordan

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous 

 

Based on your screenshots, I'm assuming you're using a relative time slicer,  the slicer and filter are always based on the time in Coordinated Universal Time (UTC). You can check the current time zone via UTCNOW()

 

vnuocmsft_0-1705046689707.png

 

 

Measure = UTCNOW()

 

 

 If you want to extract the time range in the slicer, try the following methods:

 

 

Measure = 
    var _utc = 
        CONVERT(
            UTCNOW(), 
            DATETIME
        )
    var _utc_minute = 
        TIME(
            HOUR(_utc) - 1, MINUTE(_utc), SECOND(_utc)
        )
return 
    _utc_minute
    & " to " &
    TIME(
        HOUR(_utc), MINUTE(_utc), SECOND(_utc)
    )

 

 

Here is the result, and you can dynamically get the time range by refreshing

vnuocmsft_2-1705046976755.png

 

Regards,

Nono Chen

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

 

 

Anonymous
Not applicable

Thanks for the response.

 

The code you have provided would give the desired output, except it would not update when the slicer is changed. Therefore if the slicer showed the last 2 hours, it would still only show a time window for 1 hour.

Ritaf1983
Super User
Super User

Hi @Anonymous 
You can use 
MAX/Min instead of the selected value to get the start point and end point of the selected range.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Anonymous
Not applicable

If my selected time range for the last hour is 13:53 to 14:53 and I use MIN to get the value. It will only pull the MIN value from the time column. In this case the earliest entry was 13:57 so it returned that time, rather than the 13:53 which is the bottom limit of the slicer.

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.