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
ankitp
Frequent Visitor

Spread Revenue across remaining months in FY

Hi

 

I want to be able to show the expected revenue across relevant months from potential opportunities.

 

The data looks a little like the below:

 

Opportunitu ID= ........

Opportunity Name= .......

Contract Value= $12,000

Revenue Start Date= 07/09/2022

Contract Length Months= 12

In year monthly price - $1,000

In year total Revenue - $10,000

 

I want to be able to equally split the $12,000 across the 12 months and have $1,000 in each month starting Sept-22.

oyr Fynancial year is july to june

Is it possible in DAX to do so?

I have created a Date table that is linked to my dataset.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your dataset looks like, but I tried to create a sample pbix file like below.

I hope the below can provide some ideas on how to create a solution for your dataset.

Please check the attached pbix file and the below picture.

 

Jihwan_Kim_0-1662520598232.png

 

 

Monthly Opp value measure: =
VAR _oppvaluetotal =
    SUM ( Opportunity[Contract Value] )
VAR _contractlengthmonth =
    SUM ( Opportunity[Contract Length Months] )
VAR _monthlyvalue =
    DIVIDE ( _oppvaluetotal, _contractlengthmonth )
VAR _revenuestartdate =
    EOMONTH ( MAX ( Opportunity[Revenue start date] ), -1 ) + 1
VAR _revenueenddate =
    EOMONTH ( MAX ( Opportunity[Revenue start date] ), _contractlengthmonth )
RETURN
    IF (
        _revenuestartdate <= MAX ( 'Calendar'[Date] )
            && _revenueenddate >= MIN ( 'Calendar'[Date] ),
        _monthlyvalue
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

5 REPLIES 5
ankitp
Frequent Visitor

Use the pbix file from Jihwan Kim that is almost how my data is structured

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your dataset looks like, but I tried to create a sample pbix file like below.

I hope the below can provide some ideas on how to create a solution for your dataset.

Please check the attached pbix file and the below picture.

 

Jihwan_Kim_0-1662520598232.png

 

 

Monthly Opp value measure: =
VAR _oppvaluetotal =
    SUM ( Opportunity[Contract Value] )
VAR _contractlengthmonth =
    SUM ( Opportunity[Contract Length Months] )
VAR _monthlyvalue =
    DIVIDE ( _oppvaluetotal, _contractlengthmonth )
VAR _revenuestartdate =
    EOMONTH ( MAX ( Opportunity[Revenue start date] ), -1 ) + 1
VAR _revenueenddate =
    EOMONTH ( MAX ( Opportunity[Revenue start date] ), _contractlengthmonth )
RETURN
    IF (
        _revenuestartdate <= MAX ( 'Calendar'[Date] )
            && _revenueenddate >= MIN ( 'Calendar'[Date] ),
        _monthlyvalue
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


hi

 

This is still putting the full amount in months i need it to spread over the contract period is something missing

amitchandak
Super User
Super User

danextian
Super User
Super User

Hi @ankitp ,  Can you please post a sanitized pbix of your use case?










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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