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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RyanBartz4
Regular Visitor

Prorating revenue across year

My invoice data has some annual payments and my requirement is to accrue the revenue monthly for reporting. This is a view of a particular payment made in Oct 2022 with a contract/service period of 7/1/22 to 6/30/23. 

RyanBartz4_0-1675449207348.png

The revenue is prorating nicely by each month in the service period, but I can't get it to show in the totals. 

 

Revenue Prorated = 
VAR CurrentDate = MAX( 'Date'[Date] )
VAR RevProrated = 
    CALCULATE(
        SUM( 'Invoice'[Rev Prorated] ),
        KEEPFILTERS( 'GL Lookup'[Bill Type] IN{ "Recurring", "Non-Recurring" } ),
        KEEPFILTERS( 'GL Lookup'[Tower] = "MITO" ),
        ALL( 'Date' ),
        'Invoice'[Service Start Date] <= CurrentDate,
        'Invoice'[Service End Date] >= CurrentDate,
        NOT ( ISBLANK( 'Invoice'[Service End Date] ) )
    )
RETURN
    RevProrated

 

( The two keepfilters arguements just filter my invoice table to the business unit I'm reporting on. )

 

Any help is greatly appreciated! Thanks in advance!

 

1 REPLY 1
RyanBartz4
Regular Visitor

Here are the applicable parts of my invoice table: 

RyanBartz4_0-1675450977978.png

I have a calculated column that divides the total contract revenue ( 'Invoice'[Ext Price] ) by the number of months in the contract, as follows: 

Rev Prorated = 
VAR Months = 
    IF(
        DAY( 'Invoice'[Service Start Date] ) = 01,
        DATEDIFF( 'Invoice'[Service Start Date], 'Invoice'[Service End Date], MONTH ) + 1,
        DATEDIFF( 'Invoice'[Service Start Date], 'Invoice'[Service End Date], MONTH )
    )
VAR MonthlyRevenue = 
    IF( 
        Months > 1,
        DIVIDE( 'Invoice'[Ext Price], Months )
    )
RETURN
    IF( 
        'Invoice'[Billing Frequency] IN{ "Annual", "Annually", "Multiple", "Quarterly" },
        MonthlyRevenue,
        BLANK()
    )

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.