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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AvinashPentyala
Frequent Visitor

Relative Time with Slicer

Hi All,

 

I'm experiencing an issue with my slicer not displaying the correct time when I select the last hour on desktop. The column data includes timestamps up to the current time.

Could you please suggest a solution to ensure that it shows the time interval from 8 to 9 when I select the last 1-hour range?

 

Thank you!

 

AvinashPentyala_0-1727288412356.png

 

1 ACCEPTED SOLUTION
v-heq-msft
Community Support
Community Support

Hi @AvinashPentyala ,
Thanks for Kaviraj11 reply.
Here is another possible solution

vheqmsft_0-1727318941128.png


As stated in the documentation, the anchoring time is based on UTC time, so you can create a column to display the UTC time and then filter based on the UTC time and use it  in slicer. Here are two ways to create it.
Create a calculate column in dax(My local time zone is UTC+8)

UTC Time = 'Table'[TIMESTAMP] - 8/24

Or create in power query and you need to change the type as DTAE/TIME/TIMEZONE

= Table.AddColumn(#"Changed Type", "Custom", each DateTimeZone.ToUtc(DateTime.AddZone([TIME],8)))

vheqmsft_2-1727319221056.png
The timeframe itself cannot be changed, but you can create a Mesur as a cade to override the original Slicer period

Duration = CONCATENATE(FORMAT([Last ONE HOUR],"HH:MM:SS AM/PM") & " - ", FORMAT(NOW(),"HH:MM:SS AM/PM"))

vheqmsft_3-1727319421465.png

Final output

vheqmsft_4-1727319454942.pngvheqmsft_5-1727319470488.png

Best regards,
Albert He


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

 

 

 

 

View solution in original post

6 REPLIES 6
v-heq-msft
Community Support
Community Support

Hi @AvinashPentyala ,
Thanks for Kaviraj11 reply.
Here is another possible solution

vheqmsft_0-1727318941128.png


As stated in the documentation, the anchoring time is based on UTC time, so you can create a column to display the UTC time and then filter based on the UTC time and use it  in slicer. Here are two ways to create it.
Create a calculate column in dax(My local time zone is UTC+8)

UTC Time = 'Table'[TIMESTAMP] - 8/24

Or create in power query and you need to change the type as DTAE/TIME/TIMEZONE

= Table.AddColumn(#"Changed Type", "Custom", each DateTimeZone.ToUtc(DateTime.AddZone([TIME],8)))

vheqmsft_2-1727319221056.png
The timeframe itself cannot be changed, but you can create a Mesur as a cade to override the original Slicer period

Duration = CONCATENATE(FORMAT([Last ONE HOUR],"HH:MM:SS AM/PM") & " - ", FORMAT(NOW(),"HH:MM:SS AM/PM"))

vheqmsft_3-1727319421465.png

Final output

vheqmsft_4-1727319454942.pngvheqmsft_5-1727319470488.png

Best regards,
Albert He


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

 

 

 

 

Hi @v-heq-msft 

Thank you for providing the PBIX file. I tried both options, but they aren't working. I've attached my PBIX file—could you please check if I'm missing anything?

 

PBIX File 

 

 

Hi @v-heq-msft . Please any support?

Hi @AvinashPentyala ,
After checking your pbix file, the problem you're not showing may be due to a mismatch between utc time and current time. First, the native relative time slicer uses UTC time, so you need to have a UTC time column. Second, using measure to replace the UTC time is just a change in the visual presentation, but essentially it's still a UTC time filter.
So you use UTC columns in your slicer and then create your visualization

vheqmsft_0-1727921337779.png

Best regards,
Albert He


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

 

 

 



Kaviraj11
Super User
Super User

Hi,

 

Adjust Time Zone Settings:

  • If your data includes timestamps in UTC, you might need to adjust for your local time zone.
  • You can create a new column in Power BI to adjust the time. For example:
    LocalTime = Table[Timestamp] + TIME(YourOffsetHours, 0, 0)

     

    Kaviraj11_0-1727290124945.png




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





The data is in timestamp format but not in UTC. Additionally, I’m encountering the following error when adding a column.

 

AvinashPentyala_0-1727292319123.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.