cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Day time Night time

Hi,

 

I'm fairly new to Power BI  and I'm not sure if this functionality is even avaliable but what I'm trying to do is creating a new conditional column based on a time type column "IssueTime" (08:10:00) to be divided into 3 groups under the conditional column -"Day time" = From: 06:00:00 - 19:59:59, "Night time"=20:00:00 - 05:59:59, Unknowm Time=nulls etc.." .

 

I don't know if it's even possible and if i should use M code or Dax.

Any ideas?

 

Help will Much appriciated !

1 ACCEPTED SOLUTION

@SHAKEDALROY 

 

You can accept it as the solution if it works for you

 

Thanks

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Website   YouTube    LinkedIn

View solution in original post

3 REPLIES 3
Super User IV
Super User IV

@SHAKEDALROY 

Add this as a custom column please:

=if [Issue Time] >= #time(6,0,0) and [Issue Time] <= #time(19,59,59) then "Day Time" else if
[Issue Time] >= #time(20,0,0) and [Issue Time] <= #time(23,59,59) then "Night time" else if
[Issue Time] >= #time(0,0,0) and [Issue Time] <= #time(5,59,59) then "Night time" else null

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Website   YouTube    LinkedIn

Thank you very much for your help! @Fowmy 😁

@SHAKEDALROY 

 

You can accept it as the solution if it works for you

 

Thanks

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Website   YouTube    LinkedIn

View solution in original post

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors