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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
likensj
Frequent Visitor

Unique Average and Calculated Field Scenario

I have spent the better part of a day attempting to simulate many of the very good solutions found here. I am new to DAX and still trying to learn.

 

The scenario, I have a variety of different types of clients with different types of medical insurance, each insurance has its own average days to first payment, example below:

Payors.PNG

I have a another column that has the Date of Service for each claim, lastly I have a field that indicates whether a payment has or has not been made. What I am trying to do is for each claim that has no Payment, and based on the Payor type as noted above is project a payment date for the claim, So for Instance a Claim for Code 200-Medicaid, with an original date of service of 01/01/19 would have a projected payment date of 02/19/19, based on the current average days to pay for that Code.

 

While many of the posts discuss different averaging solutions on aggregates I am not able to find anything quite fitting this scenario. I did attempt to create a new table from the original but unfortunately all it will return is the average of the entire column of 49.04 days, and not the row level average as illustrated above. 

 

Thoughts?

 

 

 

 

 

3 REPLIES 3
dax
Community Support
Community Support

Hi likensj,

I can't reproduce your design based on your description, so if possible, could you please inform me more detailed information(such as your data sample and your expecting output)? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

likensj
Frequent Visitor

Below is a sample of my data

[Date of Service][Primary Bill-To Financial Class Combo][cDays to First Payment from DOS] [cFirst Payment Amount] Payment
4/2/2019100 - MEDICARE  $                                                                        -  No Payment
4/2/2019101 - MEDICARE HMO  $                                                                        -  No Payment
4/2/2019700 - CONTRACTED INS & HMO132 $                                                               202.73Payment
4/2/2019101 - MEDICARE HMO  $                                                                        -  No Payment
4/2/2019101 - MEDICARE HMO90 $                                                               271.71Payment
4/2/2019300 - NON-CONT INS & HMO  $                                                                        -  No Payment
4/2/2019200 - MEDICAID91 $                                                                        -  No Payment
4/2/2019101 - MEDICARE HMO129 $                                                               322.68Payment
4/2/2019100 - MEDICARE63 $                                                               322.67Payment
4/2/2019900 - VETERANS ADMINISTRATION  $                                                                        -  No Payment
4/2/2019400 - PRIVATE PAY  $                                                                        -  No Payment
4/2/2019101 - MEDICARE HMO129 $                                                               378.96Payment
4/2/2019101 - MEDICARE HMO90 $                                                                        -  No Payment
4/2/2019100 - MEDICARE63 $                                                               322.67Payment
4/3/2019100 - MEDICARE62 $                                                               322.67Payment
4/3/2019400 - PRIVATE PAY  $                                                                        -  No Payment
4/3/2019700 - CONTRACTED INS & HMO  $                                                                        -  No Payment
4/4/2019700 - CONTRACTED INS & HMO  $                                                                        -  No Payment
4/4/2019100 - MEDICARE68 $                                                               322.67Payment
4/4/2019400 - PRIVATE PAY  $                                                                        -  No Payment
4/4/2019100 - MEDICARE67 $                                                               322.67Payment
4/4/2019100 - MEDICARE68 $                                                               322.67Payment
4/4/2019100 - MEDICARE67 $                                                               322.67Payment
4/4/2019101 - MEDICARE HMO62 $                                                                 83.89Payment
4/4/2019200 - MEDICAID89 $                                                                        -  No Payment
4/4/2019100 - MEDICARE119 $                                                               322.67Payment
4/4/2019100 - MEDICARE61 $                                                               322.67Payment
4/4/2019101 - MEDICARE HMO133 $                                                                        -  No Payment
4/4/2019200 - MEDICAID118 $                                                                        -  No Payment
4/4/2019101 - MEDICARE HMO127 $                                                               143.58Payment
4/4/2019100 - MEDICARE67 $                                                               322.67Payment
4/4/2019200 - MEDICAID  $                                                                        -  No Payment
4/4/2019101 - MEDICARE HMO67 $                                                                 83.89Payment
4/4/2019200 - MEDICAID83 $                                                               450.79Payment
4/4/2019101 - MEDICARE HMO104 $                                                           1,300.00Payment
4/4/2019700 - CONTRACTED INS & HMO39 $                                                               367.50Payment
4/4/2019200 - MEDICAID118 $                                                                        -  No Payment

 

Essentially what I am attempt to do create a running average of Days to First Payment for each FInancial Combo class, this will obviously change as the payment pattern of each Financial Class Combo changes over time. Then for each date of service that has No Payment, I want to create a new column that projects a future payment date, i.e., Date of service+average Days to Pay = Projected Payment Date, our Team can then quicly identify those Dates of service that have a projected payment due but is not past the projected payment date. Does that help?

 

Thanks in advance, 

 

Jason

 

dax
Community Support
Community Support

Hi 

You could try below measure to get rolling average

Measure 6 =
CALCULATE (
    SUM ( 'Table (3)'[cDays to First Payment from DOS] ),
    FILTER (
        ALL ( 'Table (3)' ),
        'Table (3)'[Primary Bill-To Financial Class Combo]
            = MIN ( 'Table (3)'[Primary Bill-To Financial Class Combo] )
            && 'Table (3)'[Date of Service] <= MIN ( 'Table (3)'[[Date of Service] )
    )
)
    / CALCULATE (
        DISTINCTCOUNT ( 'Table (3)'[Date of Service] ),
        FILTER (
            ALL ( 'Table (3)' ),
            'Table (3)'[Primary Bill-To Financial Class Combo]
                = MIN ( 'Table (3)'[Primary Bill-To Financial Class Combo] )
                && 'Table (3)'[Date of Service] <= MIN ( 'Table (3)'[Date of Service] )
        )
    )

In addition, I don't understand the Date of service+average Days to Pay = Projected Payment Date, so could you please inform me your expecting output? Then I will help you more correctly.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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