Forum Discussion
HYousuf
4 years agoNew Member
Subcategory analysis
Background: I have the following table. One patient is touched by several doctors (A, B, C) who perform various procedures (PA5, PA8, PA9, PA13). Usually PA13 precedes other ones, but not always, o...
johnt75
4 years agoSuper User
You can create a measure as below
Patient Outcome =
var patients = CALCULATETABLE(
VALUES( 'Table'[Patient] ),
REMOVEFILTERS( 'Table' ),
TREATAS( { ( SELECTEDVALUE('Table'[Doctor] ), "PA13" ) }, 'Table'[Doctor], 'Table'[Procedure] )
)
return CALCULATE( DISTINCTCOUNT( 'Table'[Patient] ),
REMOVEFILTERS( 'Table' ),
patients,
TREATAS( { "PA8", "PA9" }, 'Table'[Procedure] )
)
then create a table visual with Doctor and this measure as values