Forum Discussion
Counting the number of Diagnosis codes by context ,Specialty and provider-HelpwithPowerQuery/formula
- May 07, 2021
Arun Chandramouli Please see the attached file containing a PQ solution in the Output sheet. I have also noticed some discrepancies, probably caused by the fact that you created the example output manually.
The query is fairly standard, except for one little trick that allows you to split the "Diagnosis code" column based on the maximum number of elements in any given field. I picked it up from a video by Wyn Hopkins not too long ago.
Wyn Hopkins Will keep that in mind for next time 🙂
- Riny_van_EekelenMay 07, 2021Platinum Contributor
Arun Chandramouli Not sure I follow. You mean that if, for instance, E1 in the table has two entries for the same diagnose, you only want to count it once?
- Arun ChandramouliMay 07, 2021Brass ContributorHi Riny, Yes I meant the same...At a row level if a diagnosis code is present twice or thrice I want to count it only once...
- Riny_van_EekelenMay 07, 2021Platinum Contributor
Arun Chandramouli Okay. Then try the attached version. I just entered an extra code on the first row and it only counts once in the output. Have also simplified the query using Wyn's tip. Also added a Trim step, that will get rid for any trailing or leading spaces in the diagnose column.