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
Gaurav_Lakhotia
Helper III
Helper III

Columna calculada para la última fecha de entrenamiento - 2

Hola a todos

Escenario:
1. Hay una tabla TrainingTracker que tiene la columna Fecha (es decir, Fecha de entrenamiento). Necesito averiguar la fecha después de 28 días de la fecha de entrenamiento. (Por ejemplo: Si la fecha de entrenamiento es el 1 de septiembre de 2020 que la fecha más reciente será el 29 de septiembre de 2020, es decir, el 1 de septiembre de 2020 + 28 días).

2. En caso de que se realizaran más sesiones de capacitación dentro de los 28 días de capacitación para el mismo Cliente, la fecha de finalización del período será de 28 días después de la segunda capacitación. Por ejemplo: La primera fecha de entrenamiento es el 1 de septiembre de 2020 y dentro de los 28 días de la primera capacitación tenemos otra capacitación el 15 de septiembre de 2020, que la última fecha será el 13 de octubre de 2020, es decir, el 15 de septiembre + 28 días, para ambos entrenamientos.

3. En caso de que haya un desfase de 28 días entre la formación, entonces deberíamos considerar la siguiente capacitación como la fecha base, para todo el cálculo posterior.

Capture123.PNG

Aquí está el archivo con datos de muestra, Sample File

Por favor, ayúdame.

@amitchandak , @Greg_Deckler ,Ustedes me ayudan con el problema similar, no consideramos el Escenario 3.

Gracias.

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hola @Gaurav_Lakhotia

Para su caso, agregue dos columnas de cálculo como se indica a continuación:

durationbetweennextdate = DATEDIFF('Training Tracker'[Date],MINX (
        FILTER (
            'Training Tracker',
            'Training Tracker'[Customer Name]
                = EARLIER ( 'Training Tracker'[Customer Name] )
                && 'Training Tracker'[Date] > EARLIER ( 'Training Tracker'[Date] )
        ),
        'Training Tracker'[Date]
    ),DAY

)
Result = MAXX(TOPN(1,FILTER('Training Tracker', 'Training Tracker'[Customer Name]
                = EARLIER ( 'Training Tracker'[Customer Name] )&& 'Training Tracker'[Date] >= EARLIER ( 'Training Tracker'[Date] )&&([durationbetweennextdate]>=28||[durationbetweennextdate]=BLANK())
                ),[Date],ASC),[Date])+28

Resultado:

6.JPG

saludos

Lin

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

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hola @Gaurav_Lakhotia

Para su caso, agregue dos columnas de cálculo como se indica a continuación:

durationbetweennextdate = DATEDIFF('Training Tracker'[Date],MINX (
        FILTER (
            'Training Tracker',
            'Training Tracker'[Customer Name]
                = EARLIER ( 'Training Tracker'[Customer Name] )
                && 'Training Tracker'[Date] > EARLIER ( 'Training Tracker'[Date] )
        ),
        'Training Tracker'[Date]
    ),DAY

)
Result = MAXX(TOPN(1,FILTER('Training Tracker', 'Training Tracker'[Customer Name]
                = EARLIER ( 'Training Tracker'[Customer Name] )&& 'Training Tracker'[Date] >= EARLIER ( 'Training Tracker'[Date] )&&([durationbetweennextdate]>=28||[durationbetweennextdate]=BLANK())
                ),[Date],ASC),[Date])+28

Resultado:

6.JPG

saludos

Lin

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

Hola @v-lili6-msft ,

Gracias por la solución. Se ve genial.

Acabo de tener 1 consulta más, ¿hay una manera de identificar la primera fecha de cada ciclo en una columna?

Por favor refiérase a la imagen, "Columna: Entrenamiento válido",


Capture1234.PNG

Hola @Gaurav_Lakhotia

Simplemente agregue otra columna como se muestra a continuación:

Valid Training = IF( 'Training Tracker'[Date]= MINX(FILTER('Training Tracker',
            'Training Tracker'[Customer Name]
                = EARLIER ( 'Training Tracker'[Customer Name] )
                &&'Training Tracker'[Result]=EARLIER('Training Tracker'[Result])), 'Training Tracker'[Date]),"Y","N")

Resultado:

8.JPG

saludos

Lin

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

Hola @v-lili6-msft ,

Esto está bien, pero no manejará registros duplicados, ¿podrías ayudarme con eso?

Para ex, Si tenemos dos entrenamientos en el mismo día con el mismo cliente. Solo requerimos una formación como entrenamiento válido. El tipo de entrenador puede ser diferente,

Capture.PNG

También podemos tener una columna Index, si eso ayuda.

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.