Forum Discussion
Slicing a time range across two dates
Cheers
I am hoping you have a timestamp column. Or the date and time stamp column. Based on that have these two columns
Bucket Date = if(hour([Timestamp])<=1, [Timestamp].date-1, [Timestamp].date)
Bucket = switch(true(),
hour([Timestamp])<=1 || hour([Timestamp])>=18 , "6PM to 1AM",
/// Othe bucket logic
)
8 Replies
- amitchandak
Super User
I am hoping you have a timestamp column. Or the date and time stamp column. Based on that have these two columns
Bucket Date = if(hour([Timestamp])<=1, [Timestamp].date-1, [Timestamp].date)
Bucket = switch(true(),
hour([Timestamp])<=1 || hour([Timestamp])>=18 , "6PM to 1AM",
/// Othe bucket logic
)- tenfingers
Advocate II
- Greg_Deckler
Community Champion
Can you provide some sample data and expected output? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- tenfingers
Advocate II
Thanks for the replies.
Model is simple date and time table connected to sales facts and and another shift fact table:
I guess I am looking for a modelling approach that will let me filter a report page to be 6am to 1am and allow me to use these times on the axis of a line chart:
Cheers
- Greg_Deckler
Community Champion
Right tenfingers but I am looking to not have to type a bunch of data that may or may not be representative of your actual data formats in order to test out a solution.