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
enswitzer
Helper III
Helper III

Allocating Revenue Month over Month based on Year 1, 2 and 3 projections

I have a table that looks like this:

 

enswitzer_0-1603979583771.png

 

*copy and pasted here for ease of use

 

Project IDIdRevenue - Year 1Revenue - Year 2Revenue - Year 3DP-F Date

10nullnullnull12/19/2021
11nullnullnull7/27/2021
143,723,000.007,690,000.0012,644,000.006/8/2021
13nullnullnull12/30/2020
12nullnullnull2/17/2021
15nullnullnull3/15/2021
16nullnullnull1/11/2020
269,800,000.0010,800,000.0011,800,000.0010/29/2020
4760,000.00100,000.00120,000.009/15/2021
281,919,090.003,826,306.005,717,645.0012/1/2020
4815,050,675.0016,255,729.0017,556,187.009/29/2020
40200,000.00300,000.00450,000.0011/15/2020
31nullnullnull10/15/2020
41922,957.001,095,185.001,303,462.0010/25/2020
46272,000.00408,000.00448,800.0012/15/2020
541,286.002,248.004,012.0010/30/2020
552,602.004,637.006,877.0010/30/2020
62nullnullnull9/22/2020
64nullnullnull5/31/2021
76nullnullnull10/22/2020
77nullnullnull5/1/2021
96589.00729.00865.0011/27/2020
100835,000.00876,750.00964,430.003/31/2022
105693,380.00700,528.50729,121.5011/30/2020
154743,230.00891,870.00981,060.0012/15/2020

 

I would like to be able to output a table that shows monthly revenue based on the DP-F date in the last column. So if the project ends on 6/8/2021, as of July 1, 2021 we would start calculating revenue based on the Year 1 Revenue Number. The output would look something like this:

 

Project ID7/218/219/2110/21...8/229/2210/2211/22
14.31M.31M.31M.31M....64M.64M.64M.64
480001.25...1.251.251.351.35

 

I have NO idea where to start on this - any suggestions?

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@enswitzer,

 

Try this solution:

 

1. Create a calculated table. The data table is ProjectRevenue.

 

AllocatedProjectRevenue = 
GENERATE (
    ProjectRevenue,
    VAR vProjectID = ProjectRevenue[Project ID]
    VAR vProjectEndDate = ProjectRevenue[DP-F Date]
    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 = ProjectRevenue[Revenue - Year 1]
    VAR vRevenueYear2 = ProjectRevenue[Revenue - Year 2]
    VAR vRevenueYear3 = ProjectRevenue[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
)

 

2. In the table AllocatedProjectRevenue, set the Date column data type to Date, and format as Mm/yy.

 

DataInsights_0-1604328885313.png

 

3. Create a matrix visual based on the table AllocatedProjectRevenue.

 

DataInsights_1-1604328897293.png

 

DataInsights_2-1604328912671.png

 





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
DataInsights
Super User
Super User

@enswitzer,

 

Try this solution:

 

1. Create a calculated table. The data table is ProjectRevenue.

 

AllocatedProjectRevenue = 
GENERATE (
    ProjectRevenue,
    VAR vProjectID = ProjectRevenue[Project ID]
    VAR vProjectEndDate = ProjectRevenue[DP-F Date]
    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 = ProjectRevenue[Revenue - Year 1]
    VAR vRevenueYear2 = ProjectRevenue[Revenue - Year 2]
    VAR vRevenueYear3 = ProjectRevenue[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
)

 

2. In the table AllocatedProjectRevenue, set the Date column data type to Date, and format as Mm/yy.

 

DataInsights_0-1604328885313.png

 

3. Create a matrix visual based on the table AllocatedProjectRevenue.

 

DataInsights_1-1604328897293.png

 

DataInsights_2-1604328912671.png

 





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

Proud to be a Super User!




Thank you this worked PERFECT!!!

v-lionel-msft
Community Support
Community Support

Hi @enswitzer ,

 

What is the calculation logic of the values in the matrix? Please explain in detail.

v-lionel-msft_0-1604307471600.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.