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
HabibAdil
Helper IV
Helper IV

Tiempo de respuesta de consulta utilizando Datediff donde las fechas están en diferentes tablas

Hola

Estoy tratando de calcular el tiempo de respuesta de consulta promedio mensual en días, pero no puedo hacerlo. Por favor, ¿puedes ayudar? En el ejemplo adjunto, una oportunidad (Opp) puede tener más de 1 comillas. El tiempo de respuesta se basa en el momento en que se creó la opp y cuando se envió la primera cotización. Las tablas se unen mediante el campo OPP GUID.

Sólo para añadir un poco de complejidad extra, pero no esencial. Una cita puede ser asusitada a más de 1 Opp también.

Datediff Table.PNG

5 REPLIES 5
v-eachen-msft
Community Support
Community Support

Hola @HabibAdil ,

Puede crear una columna de clasificación al principio.

Rank =
RANKX (
    FILTER ( Quote, Quote[GUID] = EARLIER ( Quote[GUID] ) ),
    Quote[Date],
    ,
    ASC,
    DENSE
)

A continuación, utilice la función LOOKUPVALUE() o RELATED() para que coincida con el resuilt.

Result1 =
VAR a =
    LOOKUPVALUE ( Opp[Date], Opp[GUID], Quote[GUID] )
RETURN
    IF ( Quote[Rank] = 1, DATEDIFF ( a, Quote[Date], DAY ) )
Result2 =
VAR a =
    RELATED ( Opp[Date] )
RETURN
    IF ( Quote[Rank] = 1, DATEDIFF ( a, Quote[Date], DAY ) )

A continuación, muestre el promedio en el objeto visual.

1-1.PNG

Aquí está mi archivo de prueba para su referencia.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hola @v-eachen-msft, funciona muy bien. Gracias por tu ayuda!!!

Greg_Deckler
Super User
Super User

Usted podría utilizar LOOKUPVALUE o tal vez echar un vistazo a esto: https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/td-p/985814

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hola @Greg_Deckler Gracias por la ayuda. Desafortunadamente no funcionó para mí.

Datos de muestra, por favor. Por favor, consulte este post sobre cómo obtener su pregunta respondida rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.