cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HYousuf
New 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, other procedures can occur independently.

 

Question:

We want to know the how good Doctor A is when he performs procedure PA13.

Specifically, for all of Doctor A’s patients, how many of those patients end up receiving PA8 or PA9 procedures by any doctor.

 

I have provided manually filtered excel file data; obviously, I would like to achieve this result in PBI .

 

Here is the main report that we want to analyze:

Doctor

Patient

Procedure

A

1

PA13

A

1

PA8

A

2

PA9

A

3

PA13

B

3

PA5

B

3

PA8

A

4

PA5

B

4

PA13

C

4

PA8

A

5

PA8

B

6

PA13

C

6

PA9

A

7

PA13

A

7

PA9

 

I would like to

Select cases seen by Doctor A

Doctor

Patient

Procedure

A

1

PA13

A

1

PA8

A

2

PA9

A

3

PA13

A

4

PA5

A

5

PA8

A

7

PA13

A

7

PA9

 

Then calculate how many of these patients Procedure PA13( see  Patients 1,3,7)

 

Doctor

Patient

Procedure

A

1

PA13

A

1

PA8

A

2

PA9

A

3

PA13

A

4

PA5

A

5

PA8

A

7

PA13

A

7

PA9

 

Then analyze how many of these cases had PA8 or PA9 outcome, irrespective of doctor.

Doctor

Patient

Procedure

A

1

PA13

A

1

PA8

A

2

PA9

A

3

PA13

B

3

PA5

B

3

PA8

A

4

PA5

B

4

PA13

C

4

PA8

A

5

PA8

B

6

PA13

C

6

PA9

A

7

PA13

A

7

PA9

 

 

Sincerely 

Hasan 

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @HYousuf ;


Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @HYousuf ;

You could create measure as follow:

PA13 COUNT = CALCULATE(COUNT('Table'[Patient]),FILTER(ALLSELECTED('Table'),[Doctor]=MAX([Doctor])&&'Table'[Procedure]="PA13"))
PA89 count = 
var _pa13=SUMMARIZE(FILTER('Table',[Procedure]="PA13"),[Patient])
return COUNTROWS(SUMMARIZE(FILTER('Table',[Patient] in _pa13),[Patient]))

The final output is shown below:

vyalanwumsft_0-1646723499073.png

If it is not correct, please share the scene you want to output (screenshot display)
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

johnt75
Super User
Super 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

HYousuf
New Member

Good morning Parry:

 

We want to evaluate Dr. A's patient outcome. 

Specifically, if Dr. A performs PA13 procedure, then how many of those patients end up going through PA8 or PA9 procedures. (These latter PA8, PA9 procedures could be done by ANY doctor including but NOT limited to Dr. A). 

Looking forward to a solution. 

parry2k
Super User
Super User

@HYousuf thanks for the detailed explanation but it is not clear what end result do you want to achieve?






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.