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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Necesita una medida

Hola

Tengo que calcular una medida que debe basarse en la siguiente lógica:

si "fecha de fin de semana" en el medio ("fecha de inicio del trimestre" y "fecha de finalización del cuarto") entonces "Total de Horas" else "0"

Nota:"Horas totales" es una medida que otras 3 son columnas de la tabla - "fecha de fin desemana" , "fecha de inicio del trimestre" y "fecha de finalización del cuarto"

Gracias

@az38

@Greg_Deckler

6 REPLIES 6
amitchandak
Super User
Super User

La información que ha proporcionado no me está aclarando el problema. Por favor, explíquelo con un ejemplo.
Puede compartir datos de ejemplo y salida de muestra.

Vea si este archivo puede ayudarle. https://www.dropbox.com/s/bu47m5ek7sr9v8t/sales_analytics_v2.pbix?dl=0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hola

Creo que esto sería más claro:

Fecha del fin de semanaFecha de inicio del trimestreFecha de finalización del trimestreHoras totales(Medida requerida)
2/23/20201/6/20204/5/2020140140
5/20/20204/6/20207/5/20208989
1/2/20204/6/20207/5/20201230
6/8/20201/6/20204/5/2020880
3/12/20201/6/20204/5/2020212212

@sapuser ,

Cree una medida usando dax como se muestra a continuación:

Result = IF(MAX('Table'[weekend date]) >= MAX('Table'[Quarter Start Date]) && MAX('Table'[weekend date]) <= MAX('Table'[Quarter End Date]), MAX('Table'[Total Hours]), 0)

1.PNG

Equipo de Apoyo Comunitario _ Jimmy Tao

Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

az38
Community Champion
Community Champion

@sapuser

Measure=
var _weekendDate = SELECTEDVALUE(Table[weekend date])
IF(_weekendDate >= SELECTEDVALUE(Table[quarter start date]) && _weekendDate <= SELECTEDVALUE(Table[quarter end date]), Table[TotalTime], 0)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
az38
Community Champion
Community Champion

@sapuser

¿ayudará a una declaración simple como

Measure=
IF(Table[weekend date] >= Table[quarter start date] && Table[weekend date] <= Table[quarter end date], Table[TotalTime], 0)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
MFelix
Super User
Super User

Hola @sapuser ,

Consulte esta publicación sobre cómo obtener respuesta rápida a su pregunta (cortesía de @Greg_Deckler) y Cómo proporcionar datos de ejemplo en el foro de Power BI (cortesía de @ImkeF).

Sin datos de ejemplo es difícil darle una mejor ayuda.

Si puede compartir datos de ejemplo (especialmente en las columnas de fechas) y si está utilizando una tabla de calendario o fechas dentro de la tabla de datos sería útil para ayudarle.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors