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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
DataPeter
Frequent Visitor

Estandarizar la fecha en ocurrencias individuales

Hola a todos

Lector a largo plazo, comentarista por primera vez - me encanta este foro de soporte!

Problema: Estoy tratando de estandarizar las fechas de entrada de registros de clientes por ocurrencia. En resumen, quiero estandarizar el primer (y posterior) día de cada registro independientemente de la fecha/hora específica que se haya introducido. La siguiente tabla muestra el resultado ideal que me permite agrupar por clientes por el Día 1, Día2, etc.

Uso de PowerBI Desktop y datos en una hoja de cálculo en este momento. Cualquier apoyo sería muy apreciado.

ID de clienteSello de fecha y horaResultado
11 de abril de 2020 10amDía 1
11 de abril de 2020 1pmDía 1
12 de abril de 2020 10amDía 2
220 de mayo de 2020 9amDía 1
220 de mayo de 2020 1pmDía 1
221 de mayo de 2020 10amDía 2
320 de junio de 2020 10amDía 1
321 de junio de 2020 10amDía 2

Salud

Peter

1 ACCEPTED SOLUTION

@DataPeter - Debe tener un componente de tiempo, intente:

Outcome (Column) =
  VAR __Min = MINX(FILTER('Table',[Customer] = EARLIER([Customer])),[Date/Time Stamp])
RETURN
  "Day " & FLOOR((([Date/Time Stamp] - __Min) * 1. + 1),1)



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@DataPeter - Tal vez:

Outcome (Column) =
  VAR __Min = MINX(FILTER('Table',[Customer] = EARLIER([Customer])),[Date/Time Stamp])
RETURN
  "Day " & (([Date/Time Stamp] - __Min) * 1. + 1)


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Gracias @Greg_Deckler

Gracias por el apoyo, esto funcionó tipo de, sin embargo me dio decimales adicionales - cualquier pensamiento sobre cómo eliminar estos?

DataPeter_0-1599452916627.png

@DataPeter - Debe tener un componente de tiempo, intente:

Outcome (Column) =
  VAR __Min = MINX(FILTER('Table',[Customer] = EARLIER([Customer])),[Date/Time Stamp])
RETURN
  "Day " & FLOOR((([Date/Time Stamp] - __Min) * 1. + 1),1)



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@DataPeter, todos

Esto debería dar la primera fecha como nueva columna

minx(filter(Table, [CUSTOMER ID] ?earlier([Customer ID])),[Date/Time Stamp])

Usted puede tener una diferencia de fecha , y obtener días
Datediff([Date/Time Stamp],minx(filter(Table, [Customer ID] ?earlier([Customer ID])),[Date/Time Stamp]),day)

Append Day antes

"Day" & Datediff([Date/Time Stamp],minx(filter(Table, [Customer ID] ?earlier([Customer ID])),[Date/Time Stamp]),day)

Lo mismo se ha dicssuado para la creación de informes de cohortes en este seminario web -https://www.youtube.com/watch?v=Q1vPWmfI25o&t=2420s

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors