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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Y-Hernandez99P
Frequent Visitor

¿Cómo puedo comprobar si un campo tipo hora está en un rango de hora?

Buen día, mi pregunta es como puedo comprobar si la columna x está en un rango de hora? por ejemplo, de 3pm a 4pm?

Gracias por leer.

Aquí muestro como están los datos

erre.png

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @Y-Hernandez99P ,

 

Create a measure as below:

 

Measure 2 = 
var a =HOUR(SELECTEDVALUE('Table (2)'[Time]))
Return
IF(a>=15&&a<=16,1,0)

 

And you will see:

Annotation 2020-04-30 141130.png

The rows which return 1 are in the time period from 3pm to 4pm.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi @Y-Hernandez99P ,

 

Create a measure as below:

 

Measure 2 = 
var a =HOUR(SELECTEDVALUE('Table (2)'[Time]))
Return
IF(a>=15&&a<=16,1,0)

 

And you will see:

Annotation 2020-04-30 141130.png

The rows which return 1 are in the time period from 3pm to 4pm.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
amitchandak
Super User
Super User

Puede utilizar la función Hora para obtener la hora para agregaruna

Hora- Hora([Hora1])

Fin de la hora: hora([Hora1]) +1

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
camargos88
Community Champion
Community Champion

@Y-Hernandez99P ,

Puede utilizar la función TIME y IF.

https://docs.microsoft.com/en-us/dax/time-function-dax

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors