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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.