Forum Discussion
Running Total Cohort DAX
- Anonymous6 years ago
Hola @1katznir
Creo que desea calcular el total de ejecución para cada Start_OF_Month_Date por Cohort_Month.
Y compare el gasto con la medida para calcular el mínimo Cohort_Month para cada Start_OF_Month.
Construyo dos medidas:
Running Total Booking Amount = SUMX ( FILTER ( ALL ( BOOKING_MONTHLY_COHORT ), BOOKING_MONTHLY_COHORT[Start_OF_Month_Date] = MAX ( BOOKING_MONTHLY_COHORT[Start_OF_Month_Date] ) && BOOKING_MONTHLY_COHORT[Cohort_Month] <= MAX ( BOOKING_MONTHLY_COHORT[Cohort_Month] ) ), BOOKING_MONTHLY_COHORT[Booking_Amount] )M.Cohort_Month = VAR _RunningTotalExpense_Amount = SUMX ( FILTER ( ALL ( BOOKING_MONTHLY_COHORT ), BOOKING_MONTHLY_COHORT[Start_OF_Month_Date] = MAX ( BOOKING_MONTHLY_COHORT[Start_OF_Month_Date] ) && BOOKING_MONTHLY_COHORT[Cohort_Month] <= MAX ( BOOKING_MONTHLY_COHORT[Cohort_Month] ) ), BOOKING_MONTHLY_COHORT[Expense_Amount] ) VAR _COHORT = MINX ( FILTER ( ALL ( BOOKING_MONTHLY_COHORT ), BOOKING_MONTHLY_COHORT[Start_OF_Month_Date] = MAX ( BOOKING_MONTHLY_COHORT[Start_OF_Month_Date] ) && [Running Total Booking Amount] >= _RunningTotalExpense_Amount ), BOOKING_MONTHLY_COHORT[Cohort_Month] ) RETURN IF(NOT(ISBLANK(_COHORT)),IF(MAX(BOOKING_MONTHLY_COHORT[Cohort_Month])=_COHORT,_COHORT,BLANK()),BLANK())El resultado es el siguiente.
Puede descargar el archivo pbix desde este enlace: Ejecución de Total Cohort DAX
Saludos
Rico Zhou
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@1katznir
¿Puede compartir algunos datos de muestra y el resultado esperado para tener una comprensión clara de su pregunta?
Puedes guardar tus archivos en OneDrive, Google Drive o cualquier otra plataforma de uso compartido en la nube y compartir el enlace aquí.
____________________________________
¿Cómo pegar datos de muestra con su pregunta?
¿Cómo obtener respuestas a sus preguntas rápidamente?
_____________________________________
¿He respondido a tu pregunta? Marque este post como una solución, esto ayudará a otros!.
Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂