March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hi there,
I was wondering how I would go about grouping data by specific time intervals during the week.
Priority is to calculate the data based on the following filters for the below times:
Production - Monday at 12:00 am - Friday at 11:00 pm.
Maintenance - Friday at 11:00 pm-Saturday at 4:59 pm
Non - Production - Saturday at 5:00 pm - Sunday at 3:00 pm
Maintenance - Sunday at 3:00 pm - 11:59 pm
Thanks
Solved! Go to Solution.
Hi @ameerehs ,
Try to do like this, please refer to my .pbix file.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi this was really good but when I implemented to my issue it did not work. Can some help me with the below. I have date and time struggling to get the same out put as you got.
Category below
Peak - Monday to Friday between 05:00 and 16:59
Off-Peak - Monday to Friday between 17:00 and 04:59 (including Monday 00:00 to 04:59 and Friday 17:00 to Saturday 00:00)
Weekends - Saturday 00:01 until Sunday 23:59.
Whay I'm doing wrong?....
I'm trying to use DAX formula in a new column name RealShft but I just can't.
Thanks for helping.
Thanks @amitchandak , I have tried using that but doesnt seem to recognize the Non -Production time period.
Hi @ameerehs ,
Try to do like this, please refer to my .pbix file.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@ameerehs , Try like
a new column
Switch(true() ,
Weekday([Datetime],2) in {1,2,3,4} , "Production",
Weekday([Datetime],2) =5 && hour([Datetime]) <=23 , "Production",
(Weekday([Datetime],2) =5 && hour([Datetime]) <=23 ) , "Production",
(Weekday([Datetime],2) =5 && hour([Datetime]) >23) && (Weekday([Datetime],2) =6 && hour([Datetime]) <17) , "Maintenance" ,
(Weekday([Datetime],6) =6 && hour([Datetime]) > 17) && (Weekday([Datetime],2) =6 && hour([Datetime]) <= 15), "Non - Production" ,
"Maintenance"
)
User | Count |
---|---|
120 | |
77 | |
58 | |
52 | |
46 |
User | Count |
---|---|
171 | |
117 | |
63 | |
57 | |
51 |