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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors