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
sglee
Frequent Visitor

Calcular el retraso en función de la última fecha de recepción frente a docdate

Tengo una tabla con la fecha de recepción múltiple (escupir de la clave de columna de comentario por usuario), quiero calcular el día de retraso basado en la última fecha de recepción vs docdate.

CustDocDateFecha de rec 1Fecha de rec 2Fecha de rec 3Fecha de rec 4Fecha de rec 5
Cust A3/1/202010/1/20205/2/2020
Cust B10/1/202012/2/20206/3/202012/3/2020
Cust C28/1/202010/2/202015/2/202028/2/20205/3/202013/3/2020

¿Alguna fórmula que pueda usar para calcular el día de retraso en función de la última fecha recibida frente a docdate?

Gracias.

2 REPLIES 2
AllisonKennedy
Super User
Super User

Puede usar Power Query Editor para despotablear todas las fechas de rec (seleccione todas las fechas de rec y haga clic en Despivot Columns en la cinta de opciones). A continuación, utilice una matriz para trazar Cust en filas y poner la medida en valores:
Medida: DATEDIFF(Max(Rec Date 1), Max(DocDate))

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@sglee , En consulta de energía puede agregar una columna max

https://community.powerbi.com/t5/Desktop/Max-Value-between-multiple-column-for-each-row-in-a-Table/t...

Dax

https://bielite.com/blog/calculating-the-max-of-multiple-columns-or-measures-in-power-bi/

Max Rec Date á max(Table1[Rec Date1],max(Table1[Rec Date2],max(Table1[Rec Date3],max(Table1[Rec Date4],Table1[Rec Date5]))))

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.