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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
veselovartem
Regular Visitor

Updating Year End Estimation based on Forecasting Cycle slicer

Dear Community,

Hoping for your help. I have a database containing both actual financials for the years and forecasted ones.

An example is shown below. ForecastCycle=0 means that these are in fact actual results.

ForecastCycleForecastYearYearPeriodValue
0202220221100
0202220222200
0202220223300
0202320231400
0202320232500
0202320233600
0202420241700
0202420242800
0202420243900
12024202411000
12024202421100
12024202431200
22024202421300
22024202431400
32024202431500

 

I'm looking for a measure that will help me calculate Year End Estimation based on the slicer selection. For example, if a user chooses ForecastCycle=3 in a slicer, the following matrix table should be shown:

 123 
2022100200300600
20234005006001500
202470080015003000
 1200150024005100

Meaning that the measure for Cycle=3 will take periods less than 3 and will take actuals for those, and for the remainder will take forecast. I tried to use CALCULATETABLE for this, but the measure returns me 

 123 
2022600600600600
20231500150015001500
20243000300030003000
 5100510051005100

instead of correct breakdown by periods.

 

Is it even possible to do so, given the structure of data, or it should be somehow changed to arrive at the desired result?

 

Thanks a lot.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @veselovartem ,

 

You should create ForecastCycle  column as a slicer table, and then try formula like below:

vkongfanfmsft_0-1727936447950.png

YearEndEstimation = 
VAR SelectedCycle = SELECTEDVALUE('slicer'[ForecastCycle])
VAR ActualsUpToPeriod = 
    CALCULATE(
        SUM('Table'[Value]),
        'Table'[ForecastCycle] = 0,
        'Table'[Period] <= SelectedCycle
    )
VAR ForecastsFromPeriod = 
    CALCULATE(
        SUM('Table'[Value]),
        'Table'[ForecastCycle] = SelectedCycle,
        'Table'[Period] > SelectedCycle
    )
RETURN
    ActualsUpToPeriod + ForecastsFromPeriod

vkongfanfmsft_1-1727936465022.png

 

Best Regards,
Adamk Kong

 

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

5 REPLIES 5
Kedar_Pande
Super User
Super User

YearEndEstimation =
VAR SelectedCycle = SELECTEDVALUE('YourSlicerTable'[ForecastCycle])
RETURN
SUMX(
SUMMARIZE(
'YourDataTable',
'YourDataTable'[Year],
'YourDataTable'[Period],
"Value",
IF(
'YourDataTable'[ForecastCycle] < SelectedCycle,
SUMX(
FILTER(
'YourDataTable',
'YourDataTable'[ForecastCycle] = 0 &&
'YourDataTable'[Year] = EARLIER('YourDataTable'[Year]) &&
'YourDataTable'[Period] = EARLIER('YourDataTable'[Period])
),
'YourDataTable'[Value]
),
SUMX(
FILTER(
'YourDataTable',
'YourDataTable'[ForecastCycle] = SelectedCycle &&
'YourDataTable'[Year] = EARLIER('YourDataTable'[Year]) &&
'YourDataTable'[Period] = EARLIER('YourDataTable'[Period])
),
'YourDataTable'[Value]
)
)
),
[Value]
)
Anonymous
Not applicable

Hi @veselovartem ,

 

You should create ForecastCycle  column as a slicer table, and then try formula like below:

vkongfanfmsft_0-1727936447950.png

YearEndEstimation = 
VAR SelectedCycle = SELECTEDVALUE('slicer'[ForecastCycle])
VAR ActualsUpToPeriod = 
    CALCULATE(
        SUM('Table'[Value]),
        'Table'[ForecastCycle] = 0,
        'Table'[Period] <= SelectedCycle
    )
VAR ForecastsFromPeriod = 
    CALCULATE(
        SUM('Table'[Value]),
        'Table'[ForecastCycle] = SelectedCycle,
        'Table'[Period] > SelectedCycle
    )
RETURN
    ActualsUpToPeriod + ForecastsFromPeriod

vkongfanfmsft_1-1727936465022.png

 

Best Regards,
Adamk Kong

 

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

 

lbendlin
Super User
Super User

Meaning that the measure for Cycle=3 will take periods less than 3 and will take actuals for those, and for the remainder will take forecast.

where are actuals and forecast in your sample data?

All actual results are in the database with ForecastCycle=0 indicator.

So, once a period closes, a new row with cycle=0 is added and actual results for the period.

How do you want to handle the actuals for 2024? Ignore them?

 

lbendlin_0-1727956117947.png

 

lbendlin_1-1727956131571.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.