Forum Discussion

jeffshields's avatar
jeffshields
Frequent Visitor
1 year ago
Solved

Dynamic Calculation for Expiring Contract Values

Hi! Thank you in advance for any tips, support, etc...   Here's the issue: I have a contract data table where the revenue (v_rpt_agreementlist[monthly billing amount]) of the contract is summarized...
  • DataNinja777's avatar
    DataNinja777
    1 year ago

    Hi jeffshields ,

     

    Thank you for the detailed explanation. In fact, there are multiple ways to approach the topic of revenue recognition. Instead of using a fixed monthly allocation, I will demonstrate a method that allows daily proration of revenue, which is particularly useful for contracts that do not start on the 1st of the month.

    For this example, I have generated dummy data using your provided table and field names. Additionally, to facilitate daily revenue recognition across the contract period, I have added a calculated column to show the total contract value.

     

    Your data model will look like the one below, where the fact table 'v_rpt_agreementlist' has no relationship with the calendar table (a disconnected table).

    First, you will calculate the cumulative revenue recognized throughout the contract period as follows:

     

     

    Revenue recognition (Daily) = SUMX (
        v_rpt_agreementlist,
        IF (        v_rpt_agreementlist[datestart] <= MAX ( 'Calendar'[Date] )
                && v_rpt_agreementlist[dateend]>= min ( 'Calendar'[Date] ),
            v_rpt_agreementlist[Daily contract revenue]
                *( if(max( 'Calendar'[Date])<v_rpt_agreementlist[dateend],max( 'Calendar'[Date]),v_rpt_agreementlist[dateend])- v_rpt_agreementlist[datestart] ),
            BLANK ()
        )
    )

     

     

    The visualization of the above dax will look like below:

    Next, you will calculate the total contract value for the entire contract period.

     

     

    Total contract value = SUMX (
        v_rpt_agreementlist,
        IF (        v_rpt_agreementlist[datestart] <= MAX ( 'Calendar'[Date] )
                && v_rpt_agreementlist[dateend]>= min ( 'Calendar'[Date] ),
            v_rpt_agreementlist[total contract],
            BLANK ()
        )
    )

     

     

    The visualization of the DAX formula above is shown below:

    As the final step, you will subtract the recognized revenue from the total contract value to obtain the required output.

     

     

    Remaining contract = [Total contract value]-[Revenue recognition (Daily)]

     

     

    This will resemble an inverted triangle, as shown below:

    I have attached an example pbix file for your reference.

     

    Best regards,