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

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.

Reply
Anonymous
Not applicable

función datediff no dando el valor adecuado

Hola

Estoy convirtiendo tableau report en power bi . Al convertir la fórmula taleau me enfrento a algún problema. La fórmula tableau es - Total Rig days ? datediff('second','include [Job Number]: min([Date In])-, 'INCLUDE [Job Number]: max([Date Out])')

Me convertí en power bi como este -

Total Rig Day ('PROMEDIOX(RESUM/sp_ftl_dbm_tfs_summ_v2_sn,sp_ftl_dbm_tfs_summ_v2_sn[Job Number], "Date",min(sp_ftl_dbm_tfs_summ_v2_sn[min_date_in])),[Date]),('AVERAGEX(RESUM/sp_ftl_dbm_tfs_summ_v2_sn,sp_ftl_dbm_tfs_summ_v2_sn[Job Number],"Date", max(sp_ftl_dbm_tfs_summ_v2_sn[max_date_out])) ,[Fecha]))),SEGUNDO)
Pero no está dando el resultado adecuado . Intenté en measre y calculó la columna de ambos . Al intentar con la función sumx que me da un error de representación numérica no válido.
Por favor, ayuda a corregirlo.
Gracias.
3 REPLIES 3
v-xicai
Community Support
Community Support

Hola @Vgirhe ,

Puede crear una medida como DAX a continuación.

Open Count=

Var _MinDate = CALCULATE(MIN('sp_ftl_dbm_tfs_summ_v2_sn'[Date in]), ALLEXCEPT('sp_ftl_dbm_tfs_summ_v2_sn', 'sp_ftl_dbm_tfs_summ_v2_sn'[Job number]))

Var _MaxDate = CALCULATE(MAX('sp_ftl_dbm_tfs_summ_v2_sn'[Date Out]), ALLEXCEPT('sp_ftl_dbm_tfs_summ_v2_sn', 'sp_ftl_dbm_tfs_summ_v2_sn'[Job number]))

Return

DATEDIFF(_MinDate, _MaxDate, SECOND)

Saludos

Amy

Equipo de apoyo a la comunidad _ Amy

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

mahoneypat
Employee
Employee

Publique ejemplos de datos ficticios y la salida deseada. Sospecho que tu expresión DAX puede ser mucho más corta que la forma en que has empezado.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Los datos son así -

Número de trabajo Fecha en fecha de salida

17 CG 10 20/07/2019 25/09/2019

17 Fv 11 22/08/2019 28/10/2019

El día total de las plataformas viene en tableau - pero en power bi

14,589 170,296,584

16,830 186,345,256

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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