jacobrcotton
Board Regular
- Joined
- Jan 28, 2017
- Messages
- 51
New Power BI user here, and this is my first project so please go easy on me!
I dont seem to be able to post my Relationships Map directly, so I've loaded them here for viewing: https://paste.pics/54GW8.
I have three FACTs (EnrollmentDetail, ClaimsLineDetail - Paid, ClaimsLineDetail - Incurred) that are all connected via 10ish dimensions (usually labeled as "[Dimension]Key").
*Note, specifically, that the three FACT files contain no uniqueness. IE, all field values can and do appear multiple times on the FACTs.
**The ClaimsLineDetail - Paid and ClaimsLineDetail - Incurred are identical in thier data, but connected to the DateTable via Paid Date and Incurred Date, respectively.
The Claims FACTs separate $ by Medical expenses and Pharmacy Expenses. Two of my measures "TotalPaid" & "Total Incurred" is simply the sum of these two fields via code:
I'm trying to
(1) Sum the Medical & Pharmacy into Total Paid (done)
(2) Sum the Total Paid by Member ID (done)
(3) Determine the TopN (2, 5, 10, whatever) Member IDs
(4) Sum the Total Paid of just those TopN Member IDs
(5) Divide the sum of (4) by theGrand Total Paid of all IDs.
To ID my TopN, my measure code is:
The results I get are clearly incorrect, but I'm not sure why. When I compare the Grand Total Paid against the Top2 Total Paid, I get the exact same number (~$10M, which is the correct amount for the Grand Total Paid).
I dont seem to be able to post my Relationships Map directly, so I've loaded them here for viewing: https://paste.pics/54GW8.
I have three FACTs (EnrollmentDetail, ClaimsLineDetail - Paid, ClaimsLineDetail - Incurred) that are all connected via 10ish dimensions (usually labeled as "[Dimension]Key").
*Note, specifically, that the three FACT files contain no uniqueness. IE, all field values can and do appear multiple times on the FACTs.
**The ClaimsLineDetail - Paid and ClaimsLineDetail - Incurred are identical in thier data, but connected to the DateTable via Paid Date and Incurred Date, respectively.
The Claims FACTs separate $ by Medical expenses and Pharmacy Expenses. Two of my measures "TotalPaid" & "Total Incurred" is simply the sum of these two fields via code:
Code:
[COLOR=#000000][FONT=Consolas]TotalPaid = CALCULATE(sum('ClaimLinesDetail - Paid'[Medical Paid])+sum('ClaimLinesDetail - Paid'[Pharmacy Paid]))
TotalIncurred = CALCULATE(sum('ClaimLinesDetail - Incurred'[Medical Paid])+sum('ClaimLinesDetail - Incurred'[Pharmacy Paid]))[/FONT][/COLOR]
I'm trying to
(1) Sum the Medical & Pharmacy into Total Paid (done)
(2) Sum the Total Paid by Member ID (done)
(3) Determine the TopN (2, 5, 10, whatever) Member IDs
(4) Sum the Total Paid of just those TopN Member IDs
(5) Divide the sum of (4) by theGrand Total Paid of all IDs.
To ID my TopN, my measure code is:
Code:
[COLOR=#000000][FONT=Consolas]Top2PaidTest001 = CALCULATE([TotalPaid], TOPN(2, MeasuresTable, [TotalPaid], DESC))[/FONT][/COLOR]
The results I get are clearly incorrect, but I'm not sure why. When I compare the Grand Total Paid against the Top2 Total Paid, I get the exact same number (~$10M, which is the correct amount for the Grand Total Paid).