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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Pilvie
Frequent Visitor

Calculate date -1 day if has condition in time range

I'm a newbie for Power BI. I would like to create date column that show date -1 if time range in 00:00 - 6:00 am.
What's dax that I have to use for this?

 

Here's I want.

2022-07-12_190415.png

 

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @Pilvie ,

 

How about this:

tomfox_0-1657633326587.png

 

 

Here the DAX for the calculated column:

date = INT ( [start_date] - 6 / 24 )

 

Do not forget to change the Data Type to Date afterwards:

tomfox_1-1657633413494.png

 

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

2 REPLIES 2
tackytechtom
Super User
Super User

Hi @Pilvie ,

 

How about this:

tomfox_0-1657633326587.png

 

 

Here the DAX for the calculated column:

date = INT ( [start_date] - 6 / 24 )

 

Do not forget to change the Data Type to Date afterwards:

tomfox_1-1657633413494.png

 

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Great that worked!

Thank you so much.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!