Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have created a calculated column to show if certain end time (format 09:20) is false between certain ranges.
DAX used
Solved! Go to Solution.
I assumed your end time column was a Time column, but is it a DateTime? If so, you'll have to get the time component from it like this. You should consider splitting DateTime columns if not already.
7AM-10am =
VAR vTime =
TIME ( HOUR ( dilo_master[end_time] ), MINUTE ( dilo_master[end_time] ), SECOND ( dilo_master[end_time] ) )
RETURN
IF (
vTime >= TIME ( 7, 0, 0 )
&& vTime <= TIME ( 10, 0, 0 ),
TRUE (),
FALSE ()
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Please try this instead
7AM-10am = IF(dilo_master[end_time] >= TIME(7,0,0) && dilo_master[end_time] <= TIME(10,0,0) ,TRUE(),FALSE())
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
This has returned FALSE for every row. I have tried changing my end time column format between long and short time but this has not changed the output.
Thanks,
Elliot
I assumed your end time column was a Time column, but is it a DateTime? If so, you'll have to get the time component from it like this. You should consider splitting DateTime columns if not already.
7AM-10am =
VAR vTime =
TIME ( HOUR ( dilo_master[end_time] ), MINUTE ( dilo_master[end_time] ), SECOND ( dilo_master[end_time] ) )
RETURN
IF (
vTime >= TIME ( 7, 0, 0 )
&& vTime <= TIME ( 10, 0, 0 ),
TRUE (),
FALSE ()
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thats perfect. Thank you!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
71 | |
70 | |
43 | |
31 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |