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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
shkabuzar
Frequent Visitor

Calculate future month values using the previous month value

Hi, 
My data looks as below and future values to be calculated using previous month values.

Table1
year_monthValue
01-10-202010
01-11-202015
01-12-202022
01-01-202134
01-02-202112
01-03-202123
01-04-202114
01-05-202125
01-06-202124
01-07-202115
Calendar table
Date
01-10-2020
01-11-2020
01-12-2020
01-01-2021
01-02-2021
01-03-2021
01-04-2021
01-05-2021
01-06-2021
01-07-2021
01-08-2021
01-09-2021
01-10-2021
01-11-2021
01-12-2021
01-01-2022
01-02-2022
01-03-2022
01-04-2022
01-05-2022
01-06-2022
 

 

Expected data     
DateValue    
01-10-202010    
01-11-202015    
01-12-202022    
01-01-202134    
01-02-202112    
01-03-202123    
01-04-202114    
01-05-202125    
01-06-202124    
01-07-202115    
01-08-2021 expected value-previous month value*(1+0.1)15*(1+0.1)16.5
01-09-2021 expected value-(previous month value=16.5)*(1+0.1)16.5*(1+0.1)18.15
01-10-2021 expected value-(previous month value=18.15)*(1+0.1)18.15*(1+0.1)19.96
01-11-2021 continues   
01-12-2021     
01-01-2022     
01-02-2022     
01-03-2022     
01-04-2022     
01-05-2022     
01-06-2022     
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @shkabuzar ,

 

Please try the following formula to create a measure:

Measure = 
VAR _date =
    CALCULATE (
        MAX ( 'Table1'[year_month] ),
        FILTER ( 'Table1', 'Table1'[year_month] <= MAX ( 'Calendar table'[Date] ) )
    )
VAR _value =
    CALCULATE ( MAX ( 'Table1'[Value] ), 'Table1'[year_month] = _date )
VAR _monthdiff =
    DATEDIFF ( _date, MAX ( 'Calendar table'[Date] ), MONTH )
RETURN
    IF ( _monthdiff = 0, _value, _value * POWER ( 1.1, _monthdiff ) )

Here is the final output:

POWER function.PNG

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

5 REPLIES 5
Anonymous
Not applicable

Hi @shkabuzar ,

 

Please try the following formula to create a measure:

Measure = 
VAR _date =
    CALCULATE (
        MAX ( 'Table1'[year_month] ),
        FILTER ( 'Table1', 'Table1'[year_month] <= MAX ( 'Calendar table'[Date] ) )
    )
VAR _value =
    CALCULATE ( MAX ( 'Table1'[Value] ), 'Table1'[year_month] = _date )
VAR _monthdiff =
    DATEDIFF ( _date, MAX ( 'Calendar table'[Date] ), MONTH )
RETURN
    IF ( _monthdiff = 0, _value, _value * POWER ( 1.1, _monthdiff ) )

Here is the final output:

POWER function.PNG

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.

I'm interested in your solution, but I have a problem. I have my Calendar table linked to my fact table. How can I d
isplay all the future data?

todoslos meses.png

Thank you, The above measure is working for me. I have to calculate running total on the measure too, means I would like to have another measure/column with running total. The Final data should be as below. How to calculate the running total, I have tried the quick measure, but the it not giving the accurate numbers.

 

shkabuzar_0-1628783744250.png

 

 

lbendlin
Super User
Super User

What have you tried?  In Power Query you would do that via List.Accumulate() , and in DAX via PRODUCTX(). Should it be a measure or a fixed value?

 

You may also want to consider a sliding window (for example last 12 months performance).  A 10% increase month over month is not supported by your facts.

 

lbendlin_0-1628259414432.png

 

HI I have tried the below messure:

forecast=
VAR MAx_date=CALCULATE(LASTDATE(table1[year_month]),REMOVEFILTERS())
VAR last_value =
CALCULATE(
SUMx(table1,table1[Value]),
DATEADD('calendar table'[date],-1,MONTH)
)*(1+0.1)
Var result=
If(SELECTEDVALUE('calendar'[date])>[MAx_date],[value],last_value,sum(value))
return
result

Using the mesure I am geeting the value for one month,not geeting the values for entire date range.

 

Current o/p using the above measure
DateValue
01-10-202010
01-11-202015
01-12-202022
01-01-202134
01-02-202112
01-03-202123
01-04-202114
01-05-202125
01-06-202124
01-07-202115
01-08-202116.5
01-09-2021 
01-10-2021 
01-11-2021 
01-12-2021 
01-01-2022 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.