Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

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?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.