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 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!
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 |
---|---|
107 | |
94 | |
77 | |
63 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |