cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
enswitzer
Helper III
Helper III

Allocating Revenue by Month

@DataInsights was CRAZY helpful and created this calculated table that allowed me to allocate revenue by month. I'm still learning and having a little trouble following it. Is there an easy way for me to update this so that it allocates years into Fiscal Years (July through June) instead of calendar years?

 

 

AllocatedProjectRevenue = 
GENERATE (
    'PP - Project Status: Revenue',
    VAR vProjectID = 'PP - Project Status: Revenue'[Project IDId]
    VAR vProjectEndDate = 'PP - Project Status: Revenue'[DP-F]
    VAR vAllocationStartDateYear1 =
        EOMONTH ( vProjectEndDate, 1 )
    VAR vAllocationEndDateYear1 =
        EOMONTH ( vAllocationStartDateYear1, 11 )
    VAR vAllocationStartDateYear2 =
        EOMONTH ( vProjectEndDate, 13 )
    VAR vAllocationEndDateYear2 =
        EOMONTH ( vAllocationStartDateYear1, 23 )
    VAR vAllocationStartDateYear3 =
        EOMONTH ( vProjectEndDate, 25 )
    VAR vAllocationEndDateYear3 =
        EOMONTH ( vAllocationStartDateYear1, 35 )
    VAR vCalendar =
        CALENDAR ( vAllocationStartDateYear1, vAllocationEndDateYear3 )
    VAR vCalendarEOM =
        FILTER ( vCalendar, [Date] = EOMONTH ( [Date], 0 ) )
    VAR vRevenueYear1 = 'PP - Project Status: Revenue'[Revenue - Year 1]
    VAR vRevenueYear2 = 'PP - Project Status: Revenue'[Revenue - Year 2]
    VAR vRevenueYear3 = 'PP - Project Status: Revenue'[Revenue - Year 3]
    VAR vResult =
        ADDCOLUMNS (
            vCalendarEOM,
            "Amount",
                SWITCH (
                    TRUE (),
                    [Date] >= vAllocationStartDateYear1
                        && [Date] <= vAllocationEndDateYear1, vRevenueYear1 / 12,
                    [Date] >= vAllocationStartDateYear2
                        && [Date] <= vAllocationEndDateYear2, vRevenueYear2 / 12,
                    [Date] >= vAllocationStartDateYear3
                        && [Date] <= vAllocationEndDateYear3, vRevenueYear3 / 12
                )
        )
    RETURN
        vResult
)

 

 

 

To Clarify - I think I'm the one that made the year part happen, and probably not eloquently:

 

This Year Additional Revenue = SUMX(filter(AllocatedProjectRevenue, AllocatedProjectRevenue[Year]=year(today())),AllocatedProjectRevenue[Amount])

2 Year Out Revenue = SUMX(filter(AllocatedProjectRevenue, AllocatedProjectRevenue[Year]=(year(today())+2)),AllocatedProjectRevenue[Amount])

3 Year Out Revenue = SUMX(filter(AllocatedProjectRevenue, AllocatedProjectRevenue[Year]=(year(today())+3)),AllocatedProjectRevenue[Amount])

 

 

So if there are any suggestions to make this by fiscal year instead - it would be much appreciated! (and to just clean up my code, I'm definitely trying to learn!)

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@enswitzer,

 

Glad you found the calculated table helpful. I believe the simplest approach would be to add the columns Fiscal Year and Fiscal Month to your Date table. Then, create a relationship between the calculated table and the Date table (using the Date column in each table). Now you can create a visual and filter/slice on Fiscal Year/Month.

 

If you could provide a mockup of the desired result for a particular project, I'll take a look.





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@enswitzer,

 

Glad you found the calculated table helpful. I believe the simplest approach would be to add the columns Fiscal Year and Fiscal Month to your Date table. Then, create a relationship between the calculated table and the Date table (using the Date column in each table). Now you can create a visual and filter/slice on Fiscal Year/Month.

 

If you could provide a mockup of the desired result for a particular project, I'll take a look.





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

Proud to be a Super User!




I actually did just that (I tried to post it, but it didn't go through... sorry)

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors