Return Data in Same Table
-
2012年7月9日 下午 06:37
Hello,
I have a data table in powerpivot with doctor information and patient information which includes the patients referring doctor.
Cust Type Customer ID Customer Name Doctor Typ Referring Doctor ID Referring Doctor Name Referring Doctor ID Doctor 00ABC Doctor Dr John Smith M.D. N/A N/A =Doctor's Doc Type Patient 00XYZ Patient Mr. Patient N/A 00ABC Doctor Dr John Smith Should = Referring Doc Type Does any one know a simple formula that I could add as a calculated column to the referring doctor id field for patients? This will allow me to roll up sales for a particular doctor type including their patients.
Thank you in advance for any help you could provide.
所有回覆
-
2012年7月12日 下午 12:22
something like
=IF([Cust Type] = "Doctor", [Doctor Type], LOOKUPVALUE(MyTable[Doctor Type], MyTable[Customer ID], MyTable[Referring Doctor ID]))
so if the current row is of type Doctor, we can simply take the DoctorType of the current row
otherwises we have to lookup the DoctorType of the referring Docotorhth,
gerhard- www.pmOne.com -
- 已標示為解答 kppurcell 2012年7月12日 下午 05:10
-
2012年7月12日 下午 05:10
Gerhard,
That worked perfectly! Thank you very much.
Kevin

