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
Básicamente tengo una tabla de fechas, pacientes, proveedores y códigos de procedimiento. Necesito devolver otro valor si una visita al paciente en una fecha en particular, con un proveedor en particular tiene 2 códigos / categorías de procedimiento específicos.
Svc_DateClinic IDPatient IDProvider IDProcedure Code IDProcedure Category ID
4/1/2021 | Denver | 1234 | James | 26 | No Covid |
4/1/2021 | Denver | 1234 | James | 27 | No Covid |
4/1/2021 | Denver | 1234 | James | 28 | No Covid |
4/2/2021 | Manantiales de Colorado | 2234 | Andrews | 02 | Visita a la oficina |
4/2/2021 | Manantiales de Colorado | 2234 | Andrews | 02 | Visita a la oficina |
4/2/2021 | Manantiales de Colorado | 2234 | Andrews | 29 | Prueba covid |
4/3/2021 | aurora | 5545 | subvención | 09 | Prueba covid |
4/3/2021 | aurora | 5545 | subvención | 30 | Visita a la oficina |
4/3/2021 | aurora | 5545 | subvención | 31 | Visita a la oficina |
4/4/2021 | Parker | 2234 | Andrews | 02 | Visita a la oficina |
4/4/2021 | Parker | 2234 | Andrews | 07 | Visita a la oficina |
4/4/2021 | Parker | 2234 | Andrews | 32 | Visita a la oficina |
4/4/2021 | Denver | 5545 | James | 49 | Vacuna covid |
4/4/2021 | Denver | 5545 | James | 50 | Visita a la oficina |
4/5/2021 | Denver | 1234 | Andrews | 40 | Vacuna covid |
Si una visita contiene una visita al consultorio y una prueba de Covid, entonces necesito devolver un texto. Lo mismo ocurre con las visitas que son solo Visitas al Consultorio y solo Vacunas Covid.
Por favor, hágamelo saber si tiene alguna pregunta!
Solved! Go to Solution.
Hay @jcarb0321 ,
Puede crear esta columna de cálculo:
A =
VAR _count =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Procedure Category ID] ),
FILTER (
ALL ( 'Table' ),
'Table'[Procedure Category ID] <> "Non-Covid"
&& 'Table'[Svc_Date] = EARLIER ( 'Table'[Svc_Date] )
&& 'Table'[Patient ID] = EARLIER ( 'Table'[Patient ID] )
&& 'Table'[Provider ID] = EARLIER ( 'Table'[Provider ID] )
)
)
RETURN
SWITCH (
TRUE (),
_count >= 2, "Office Visit and Covid Test",
_count = 1, "Only " & [Procedure Category ID]
)
Saludos
Equipo de apoyo a la comunidad _ Yingjie Li
Si este post ayuda,entonces por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hay @jcarb0321 ,
Puede crear esta columna de cálculo:
A =
VAR _count =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Procedure Category ID] ),
FILTER (
ALL ( 'Table' ),
'Table'[Procedure Category ID] <> "Non-Covid"
&& 'Table'[Svc_Date] = EARLIER ( 'Table'[Svc_Date] )
&& 'Table'[Patient ID] = EARLIER ( 'Table'[Patient ID] )
&& 'Table'[Provider ID] = EARLIER ( 'Table'[Provider ID] )
)
)
RETURN
SWITCH (
TRUE (),
_count >= 2, "Office Visit and Covid Test",
_count = 1, "Only " & [Procedure Category ID]
)
Saludos
Equipo de apoyo a la comunidad _ Yingjie Li
Si este post ayuda,entonces por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@jcarb0321
Por favor, agregue la siguiente columna y compruebe:
Visit Type =
var __filter = ALlEXCEPT(Table2,Table2[Svc_Date],Table2[Patient ID],Table2[Provider ID])
var __table = CALCULATETABLE(VALUES(Table2[Procedure Category ID]),__filter)
var __all = CALCULATE( COUNTROWS(Table2), __filter)
VAR __testoffice = COUNTROWS(FILTER(__table , Table2[Procedure Category ID] in {"Covid Test", "Office Visit"} )) >= 2
VAR __office = CALCULATE( COUNTROWS(Table2), __filter, Table2[Procedure Category ID] = "Office Visit") = __all
VAR __vaccine = CALCULATE( COUNTROWS(Table2),__filter, Table2[Procedure Category ID] = "Covid Vaccine") = __all
return
SWITCH(
TRUE(),
__testoffice=TRUE(),"Office Visit and Test",
__office=TRUE(),"Office Visit only",
__vaccine=TRUE(), "'Vaccine Only"
)
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 |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |