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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. 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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors
Top Kudoed Authors