Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
I've not worked with creating a custom formulae where time comparisions are used and was hoping for some pointers.
I have two columns:
I want to create a cusotm column called BookedTimeBusinessHours that returns a Y/N response for each row where:
Any tips on the formulae requried to acheive this?
Solved! Go to Solution.
hi there,
use this formula for the BookedTimeBusinessHours column:
= if Time.Hour([AppointmentBookedTime]) >= 9 and Time.Hour([AppointmentBookedTime]) <= 17
then "Y"
else "N"
hope this works for you,
radpir
Hi @Anonymous,
radpir's solution seems well, I convert this to dax, you can refer to it:
BookedTimeBusinessHours =
var currentTime=TIME(HOUR([AppointmentBookedTime]),MINUTE([AppointmentBookedTime]),SECOND([AppointmentBookedTime]))
return
IF(AND(currentTime>=TIME(9,0,0),currentTime<=TIME(17,0,0)),"Y","N")
Regards,
Xiaoxin Sheng
Please Help Me to answer similar case on this new thread : http://community.powerbi.com/t5/Desktop/Creating-conditional-column-based-on-time-for-another-column...
Hi @Anonymous,
radpir's solution seems well, I convert this to dax, you can refer to it:
BookedTimeBusinessHours =
var currentTime=TIME(HOUR([AppointmentBookedTime]),MINUTE([AppointmentBookedTime]),SECOND([AppointmentBookedTime]))
return
IF(AND(currentTime>=TIME(9,0,0),currentTime<=TIME(17,0,0)),"Y","N")
Regards,
Xiaoxin Sheng
Please Help Me to answer similar case on this new thread: http://community.powerbi.com/t5/Desktop/Creating-conditional-column-based-on-time-for-another-column...
Thank, Xiaoxin! Worked perfectly.
hi there,
use this formula for the BookedTimeBusinessHours column:
= if Time.Hour([AppointmentBookedTime]) >= 9 and Time.Hour([AppointmentBookedTime]) <= 17
then "Y"
else "N"
hope this works for you,
radpir
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 59 | |
| 31 | |
| 25 | |
| 25 |