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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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