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.
Hola a todos,
Tengo una tabla de clientes y estoy tratando de contar el total único de cada mes, por ejemplo, compruebe la siguiente tabla
Cliente | Mes |
123 | 1 |
123 | 1 |
1234 | 2 |
123 | 3 |
1234 | 3 |
12345 | 4 |
Estoy tratando de crear una fórmula más optimizada del siguiente código DAX
CALCULATE (
DISTINCTCOUNT ( 'table'[customer] ),
KEEPFILTERS ( 'table'[Month] = 1 )
)
+
CALCULATE (
DISTINCTCOUNT ( 'table'[customer] ),
KEEPFILTERS ( 'table'[Month] = 2 )
)
+
CALCULATE (
DISTINCTCOUNT ( 'table'[customer] ),
KEEPFILTERS ( 'table'[Month] = 3 )
)
+
CALCULATE (
DISTINCTCOUNT ( 'table'[customer] ),
KEEPFILTERS ( 'table'[Month] = 4 )
)
Solved! Go to Solution.
@Mohannad17 - ¿Estás tratando de lograr:
Measure =
CALCULATE(
DISTINCTCOUNT('Table'[customer]),
ALLEXCEPT(
'Table',
'Table'[month]
)
)
Proud to be a Super User!
Hola @Mohannad17 ,
Estos son los pasos que puede seguir:
1. Crear medida.
Measure =
CALCULATE(COUNT('Table'[customer]),FILTER('Table','Table'[month]=MAX('Table'[month])))
2. Resultado
Puede descargar el archivo PBIX desde aquí.
Saludos
Liu Yang
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@Mohannad17 - ¿Estás tratando de lograr:
Measure =
CALCULATE(
DISTINCTCOUNT('Table'[customer]),
ALLEXCEPT(
'Table',
'Table'[month]
)
)
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |