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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
amandabus21
Helper V
Helper V

24 hour day switch

Hello, 

 

How can I change my 24 hour revenue "day" to be from 2:59AM - 3:01AM the next day?  

 

My data is in the current form of 12:00 - 12:00 but need a seperate column/ measure for our working revenue day.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@amandabus21 , Assume you have timestamp (Date + time) 

 

Create a new column like

Correct date =

var _time = timevalue([Datetime])

var _date - datevalue([Datetime])

return

if(_time  < time(3,0,0) , _date  -1, _date)

 

Change this as per need

View solution in original post

5 REPLIES 5
amandabus21
Helper V
Helper V

Hi, 

 

I only have one table named "OccurenceTimeStamp" The table has data and time already together.

 

I want the slicer to be able to filter between 2:59AM - 3:01AM and not change my data.

amandabus21_0-1661985365778.png

 

 

 

Hi @amandabus21 ,

First, you need to create a time dimension table. And do not create any relationship with the fact table. Then you can create a measure with the conditions:

  • if the time between 2:59 and 24:00 then current day
  • if the time between 0:00 and 3:01 then current day+1

How did you want to display the data on the visual using the fact table? Could you please provide more details on your requirement? Thank you.

Best Regards

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

Hello, 

 

I am still unable to solve

So do i need to create two seperate columns? One with date and one with time? 

 

If i do that, what measure do I use after that?

 

I want to filter all my information based on the 2:59AM - 3:01AM clock. So for example I want to know how many late buses happened on 9/1/22. but on 9/1/22 from 2:59AM - 3:01AM

amitchandak
Super User
Super User

@amandabus21 , Assume you have timestamp (Date + time) 

 

Create a new column like

Correct date =

var _time = timevalue([Datetime])

var _date - datevalue([Datetime])

return

if(_time  < time(3,0,0) , _date  -1, _date)

 

Change this as per need

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors