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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JRHans09
Resolver II
Resolver II

Calculate amount of revenue that should have been in previous period based on service date

We have revenue posted in months based on invoice date, but we would like to know what revenue should have been posted in previous periods based on service dates. For example, if the invoicing period is June, I would need to calculate the revenue from all invoices in June that have Service Dates prior to June.

 

 I know the below DAX does not work, but it highlights what I am trying to do:

 

 

 

USD Inv - Rollover =
CALCULATE(
    [USD Invoiced],
    ALLSELECTED( Dates ),
    USERELATIONSHIP( Invoices[Date Service], Dates[Date] ),
    DATESBETWEEN(
        Dates[Date],
        MIN( Invoices[Date Service] ),
        MIN( Invoices[Date Invoice] )
    )
)

 

 

 

Here is a screen shot showing what I would like to calculate:
Rollover Revenue.png

 

Any help would be greatly appreciated. Thanks.

1 ACCEPTED SOLUTION

I figured it out:

 

USD Inv - Rollover = 
VAR MinInv =
    CALCULATE (
        MIN ( Invoices[Date Invoice] ),
    )
VAR Prev = 
    FILTER (
        VALUES ( Invoices[Date Service] ),
        Invoices[Date Service] < MinInv
        && NOT( ISBLANK ( Invoices[Date Service] ) )
    )
VAR Result = 
    CALCULATE (
        [USD Invoiced],
        ( Prev )
    )
RETURN
Result

View solution in original post

4 REPLIES 4
Kumail
Post Prodigy
Post Prodigy

Hello @JRHans09 

 

If you could send sample .pbix that demonstrate what you are looking to get. It would really help providing you a quick solution.
 
You can send the sample .pbix file by adding it to your drive or dropbox and add the link here. 
 
Regards
Kumail Raza

I figured it out:

 

USD Inv - Rollover = 
VAR MinInv =
    CALCULATE (
        MIN ( Invoices[Date Invoice] ),
    )
VAR Prev = 
    FILTER (
        VALUES ( Invoices[Date Service] ),
        Invoices[Date Service] < MinInv
        && NOT( ISBLANK ( Invoices[Date Service] ) )
    )
VAR Result = 
    CALCULATE (
        [USD Invoiced],
        ( Prev )
    )
RETURN
Result
Ashish_Mathur
Super User
Super User

Hi,

Cannot understand anything from such a small image.  Share the download link of your file with your notes in there (as seen in the screenshot) and show the expected result there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Clicking to expand the image should provide sufficient resolution to view the screen shot.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.