Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hola
En primer lugar, lo siento por mi inglés.
Queremos restituir el número de documentos en cada estado por fecha.
A mi tabla de hechos le gusta :
Usuarios | Evento de fecha | Escriba evento |
1 | 01/03/2020 | Sended |
1 | 04/03/2020 | Recevied |
1 | 06/03/2020 | Integrado |
1 | 06/03/2020 | Terminado |
2 | 01/03/2020 | Sended |
2 | 03/03/2020 | Recibido |
3 | 02/03/2020 | Sended |
3 | 10/03/2020 | Recibido |
3 | 11/03/2020 | Integrado |
3 | 15/03/2020 | Terminado |
4 | 05/03/2020 | Sended |
4 | 06/03/2020 | Recibido |
4 | 07/03/2020 | Integrado |
El documento de flujo de trabajo es: Sended, received, integrated y finished
Tengo 3 dimensiones: fecha, evento de tipo de usuario.
En cada fecha, quiero saber el stock en cada evento de tipo:
Eventos de tipo | 01/03/2020 | 02/03/2020 | 03/03/2020 | 04/03/2020 | 05/03/2020 | 06/03/2020 | 07/03/2020 | 08/03/2020 | 09/03/2020 | 10/03/2020 | 11/03/2020 | 12/03/2020 | 13/03/2020 | 14/03/2020 | 15/03/2020 |
Sended | 2 | 3 | 2 | 1 | 2 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
Recibido | 0 | 0 | 1 | 2 | 2 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 1 | 1 | 1 |
Integrado | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 2 | 2 | 2 | 2 | 1 |
Terminar | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 |
Quiero crear una medida, pero no sé la sintaxis dax que puede hacerlo.
Gracias por su ayuda
Hola @gringo89 ,
Podemos usar los siguientes pasos para cumplir con sus requisitos.
Measure =
COUNTROWS (
FILTER (
SUMMARIZE (
FILTER (
ALLSELECTED ( 'fact table' ),
'fact table'[Date event] <= MIN ( 'Dim Date'[Date] )
),
'fact table'[users],
"LastType",
VAR maxIndex =
CALCULATE (
MAX ( 'fact table'[Index] )
)
RETURN
CALCULATE (
MAX ( 'fact table'[Type event] ),
'fact table'[Index] = maxIndex
)
),
[LastType] IN DISTINCT ( 'Dim Type event'[Type event] )
)
) +0
BTW, pbix como adjunto.
Saludos
Hola @v miembro-msft
gracias por su ayuda.
Creo que este enfoque puede resolver mi requisito.
Utilizo la conexión en vivo SSAS (versión 2016) y tengo un error con la sintaxis 'IN DISTINCT'. No entiendo...
Hummm.. el operador 'in' no es compatible con sql server 2016 (compatible con 1200 tabular) 😞
Hola a todos
¿Alguna solución para este requisito?