Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 @jreynolds,
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 @jreynolds,
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |