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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.