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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Group interval 15 min by value

Hello dear community.
I have a question about the intervals.
I currently have an Interval column which I made like this:
Time.from (Number.RoundDown (96 * Number.From (Time.From ([column1])) / 1) / 96). I have the interval.

I get this : 

DimitriD_0-1635874418288.png

As you see its working fine


Now I need to group interval like this
Example 08:00-> 08:14:59 -> 08:00
08:15:00 -> 08:29:59 -> 08:15
08: 30: 00-> 08:44:59 -> 08:30
08:45:00 -> 08:59:59 -> 08:45-08:59

 

Can you help me, please ,

 

Thank you 

 

1 ACCEPTED SOLUTION

@Anonymous 
This should do it:

 

NewTarget = 
var getHour = HOUR(Interval2[Time 1])
var getMinute = MINUTE(Interval2[Time 1])
var IntervalToText = FORMAT(Interval2[Interval ],"h:mm")
var checkInterval = if(getMinute>=45,getHour & ":45 - " & getHour & ":59",IntervalToText)

return checkInterval

vojtechsima_0-1635881978428.png

 

View solution in original post

6 REPLIES 6
vojtechsima
Memorable Member
Memorable Member

Hi, @Anonymous 

If I get you correctly, you have a baseline of intervals and then you have random time and you want to assign the correct baseline Interval to the random time, right?
See my solution:

IntervalGroup = maxx(Filter(Interval,Interval_Lookup[Interval_Lookup]>=Interval[Interval]),Interval[Interval])

Table with the random dates with assigned values from a different table.

vojtechsima_0-1635877122948.png

The Original Table

vojtechsima_1-1635877175226.png

 

Anonymous
Not applicable

Hello @vojtechsima , 

 

thank you for your reply. 

No, its perhaps my bad. 

I have already Time 1 and Interval and its working fine but I need column Target as yu see, the range xx:45 to xx:59 is not xx:45 but xx:45 - xx:59

If I had to say it litteraly
Example If I take 08:00
if Time 1 is between 08:00:00 and 08:14:59 then 08:00
If Time1 is between 08:15:00 and 08:29:59 then 08:15
If Time1 is between 08:30:00 and 08:44:59 then 08:30 otherwise 08:45 - 09:00)
Well this for every hour.

 

 

Time 1Interval Target
08:12:1408:00:0008:00
09:19:4809:15:0009:15
09:35:2309:30:0009:30
09:45:5909:45:0009:45 - 09:59

@Anonymous 
This should do it:

 

NewTarget = 
var getHour = HOUR(Interval2[Time 1])
var getMinute = MINUTE(Interval2[Time 1])
var IntervalToText = FORMAT(Interval2[Interval ],"h:mm")
var checkInterval = if(getMinute>=45,getHour & ":45 - " & getHour & ":59",IntervalToText)

return checkInterval

vojtechsima_0-1635881978428.png

 

Anonymous
Not applicable

Hello @vojtechsima 

 

 

Awesome. I didn't have to think about that at all, I had stayed on the grouping of values.
A big thank you.

 

@Anonymous , I am glad to hear that, please, if you could mark my original reply as the solution, so this threat is closed. Thank you

Anonymous
Not applicable

@vojtechsima 

Its done :).

Thank you 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.