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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
WNT
Frequent Visitor

Forecast based on last know value

I have a fact table with a StartDate, EndDate and amount (in this case FTE). I want to "pretend" like the end date doesn't exist and prolong the amount in the feature. See the example below of what I want to achieve (the red letters).
I have tried all kind of calculations but I don't seem to get the right result. Any suggestions?

 

VraagForecast.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @WNT ,

 

Please try the following formula to create a new table firstly:

New Table =
TOPN (
    12,
    DISTINCT (
        SELECTCOLUMNS (
            CALENDAR ( MIN ( 'Fact'[StartDatumA] ), MAX ( 'Fact'[EindDatumA] ) ),
            "YearMonth",
                YEAR ( [Date] ) * 100
                    + MONTH ( [Date] ),
            "Month", FORMAT ( [Date], "MMMM" ),
            "Value",
                LOOKUPVALUE (
                    'Table'[_D3],
                    'Table'[Maand], FORMAT ( [Date], "MMMM" ),
                    'Table'[Jaar], YEAR ( [Date] )
                )
        )
    )
)

 Then add the measure:

Measure =
IF (
    MAX ( 'Table'[Jaar] ) > YEAR ( MAX ( 'Fact'[StartDatumA] ) ),
    CALCULATE (
        MIN ( 'New Table'[Value] ),
        FILTER ( 'New Table', 'New Table'[Month] = MAX ( 'Table'[Maand] ) )
    )
)

The final output is shown below:

3.17.2.new table.PNG

 

Here is the pbix file.

 

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

View solution in original post

2 REPLIES 2
WNT
Frequent Visitor

@Anonymous thanks for the reply! I'll try to duplicate it in my own environement this weekend and let you know if this is the solution

Anonymous
Not applicable

Hi @WNT ,

 

Please try the following formula to create a new table firstly:

New Table =
TOPN (
    12,
    DISTINCT (
        SELECTCOLUMNS (
            CALENDAR ( MIN ( 'Fact'[StartDatumA] ), MAX ( 'Fact'[EindDatumA] ) ),
            "YearMonth",
                YEAR ( [Date] ) * 100
                    + MONTH ( [Date] ),
            "Month", FORMAT ( [Date], "MMMM" ),
            "Value",
                LOOKUPVALUE (
                    'Table'[_D3],
                    'Table'[Maand], FORMAT ( [Date], "MMMM" ),
                    'Table'[Jaar], YEAR ( [Date] )
                )
        )
    )
)

 Then add the measure:

Measure =
IF (
    MAX ( 'Table'[Jaar] ) > YEAR ( MAX ( 'Fact'[StartDatumA] ) ),
    CALCULATE (
        MIN ( 'New Table'[Value] ),
        FILTER ( 'New Table', 'New Table'[Month] = MAX ( 'Table'[Maand] ) )
    )
)

The final output is shown below:

3.17.2.new table.PNG

 

Here is the pbix file.

 

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors