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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Khalefa
Helper I
Helper I

DAX to calculate Forecast change in different week versions

Hi there

i just need some help according to the below description

 

1- I receive a forecast version every week with the upcoming 12 weeks and in every version, we drop one older and add a new week forecast to the new version

2- sample is provided with the data and the needed Dax

 3- want to compute WOW in each version of the forecast

4- then want to calculate the change rate for each week in all the versions of the forecast

5- need to have a trend line for the above point

 

Request 1Week versionWeekPrevious week forecast
  V-W43W4356017
  W4439376
  W45 
  W46?
  W47?
  W48?
  W49?
  W50?
  W51?
  W52?
  W1?
  W2?

 

 

Request2    
 WeekV-W44V-W45V-W46
 W443937650194 
 W45   
 W46   
 W47   
 W48   
 W49   
 W50   
 W51   
 W52   
 W1   
 W2   
 W3  

 

 

 

 

Request3WeekV-W44V-W45
 W44 27%
 W45  
 W46  
 W47  
 W48  
 W49  
 W50  
 W51  
 W52  
 W1  
 W2  
 W3  

 

data sample

 

Week versionWeekDayForecast

V-W43W4310/24/20225648
V-W43W4310/25/20229742
V-W43W4310/26/20229631
V-W43W4310/27/20229571
V-W43W4310/28/20225029
V-W43W4310/29/20226744
V-W43W4310/30/20229652
V-W43W4410/31/20225577
V-W43W4411/1/20225597
V-W43W4411/2/20224861
V-W43W4411/3/20223716
V-W43W4411/4/20227869
V-W43W4411/5/20227251
V-W43W4411/6/20224505
V-W43W4511/7/20228263
V-W43W4511/8/20223254
V-W43W4511/9/20224467
V-W43W4511/10/20224962
V-W43W4511/11/20228317
V-W43W4511/12/20223922
V-W43W4511/13/20228128
V-W43W4611/14/20227376
V-W43W4611/15/20226125
V-W43W4611/16/20224566
V-W43W4611/17/20224292
V-W43W4611/18/20224148
V-W43W4611/19/20223678
V-W43W4611/20/20225069
V-W43W4711/21/20228275
V-W43W4711/22/20229874
V-W43W4711/23/20224458
V-W43W4711/24/20227879
V-W43W4711/25/20225388
V-W43W4711/26/20227319
V-W43W4711/27/20228500
V-W43W4811/28/20229172
V-W43W4811/29/20227613
V-W43W4811/30/20229009
V-W43W4812/1/20223332
V-W43W4812/2/20228579
V-W43W4812/3/20226889
V-W43W4812/4/20229968
V-W43W4912/5/20229079
V-W43W4912/6/20223430
V-W43W4912/7/20223115
V-W43W4912/8/20229024
V-W43W4912/9/20227045
V-W43W4912/10/20224086
V-W43W4912/11/20225662
V-W43W5012/12/20223785
V-W43W5012/13/20229720
V-W43W5012/14/20228653
V-W43W5012/15/20227944
V-W43W5012/16/20226001
V-W43W5012/17/20224686
V-W43W5012/18/20225769
V-W43W5112/19/20227651
V-W43W5112/20/20224973
V-W43W5112/21/20227938
V-W43W5112/22/20229714
V-W43W5112/23/20225484
V-W43W5112/24/20224959
V-W43W5112/25/20223682
V-W43W5212/26/20225824
V-W43W5212/27/20227256
V-W43W5212/28/20228934
V-W43W5212/29/20228231
V-W43W5212/30/20226306
V-W43W5212/31/20224224
V-W43W521/1/20239254
V-W43W11/2/20235598
V-W43W11/3/20238035
V-W43W11/4/20238971
V-W43W11/5/20238451
V-W43W11/6/20234240
V-W43W11/7/20239424
V-W43W11/8/20235246
V-W43W21/9/20233536
V-W43W21/10/20233723
V-W43W21/11/20236508
V-W43W21/12/20238161
V-W43W21/13/20233224
V-W43W21/14/20235575
V-W43W21/15/20238183
V-W44W4410/31/20226705
V-W44W4411/1/20224831
V-W44W4411/2/20226712
V-W44W4411/3/20229054
V-W44W4411/4/20224880
V-W44W4411/5/20229750
V-W44W4411/6/20228262
V-W44W4511/7/20226220
V-W44W4511/8/20226666
V-W44W4511/9/20223513
V-W44W4511/10/20226036
V-W44W4511/11/20225669
V-W44W4511/12/20223390
V-W44W4511/13/20225497
V-W44W4611/14/20229656
V-W44W4611/15/20226206
V-W44W4611/16/20226322
V-W44W4611/17/20229103
V-W44W4611/18/20225968
V-W44W4611/19/20227016
V-W44W4611/20/20223115
V-W44W4711/21/20226130
V-W44W4711/22/20227936
V-W44W4711/23/20229388
V-W44W4711/24/20226716
V-W44W4711/25/20223001
V-W44W4711/26/20224624
V-W44W4711/27/20227567
V-W44W4811/28/20229537
V-W44W4811/29/20224935
V-W44W4811/30/20229776
V-W44W4812/1/20228037
V-W44W4812/2/20227076
V-W44W4812/3/20227846
V-W44W4812/4/20224597
V-W44W4912/5/20228441
V-W44W4912/6/20226714
V-W44W4912/7/20226678
V-W44W4912/8/20224241
V-W44W4912/9/20225698
V-W44W4912/10/20227848
V-W44W4912/11/20224031
V-W44W5012/12/20228737
V-W44W5012/13/20227110
V-W44W5012/14/20223040
V-W44W5012/15/20223868
V-W44W5012/16/20225294
V-W44W5012/17/20224997
V-W44W5012/18/20229301
V-W44W5112/19/20225930
V-W44W5112/20/20224655
V-W44W5112/21/20226481
V-W44W5112/22/20223178
V-W44W5112/23/20229633
V-W44W5112/24/20224792
V-W44W5112/25/20227116
V-W44W5212/26/20225975
V-W44W5212/27/20228426
V-W44W5212/28/20224825
V-W44W5212/29/20225889
V-W44W5212/30/20226646
V-W44W5212/31/20223440
V-W44W521/1/20235311
V-W44W11/2/20235336
V-W44W11/3/20237763
V-W44W11/4/20239124
V-W44W11/5/20233933
V-W44W11/6/20238333
V-W44W11/7/20233086
V-W44W11/8/20233711
V-W44W21/9/20236120
V-W44W21/10/20234264
V-W44W21/11/20233160
V-W44W21/12/20237279
V-W44W21/13/20234641
V-W44W21/14/20233712
V-W44W21/15/20239510
V-W44W31/16/20239042
V-W44W31/17/20234982
V-W44W31/18/20233162
V-W44W31/19/20239696
V-W44W31/20/20238238
V-W44W31/21/20239145
V-W44W31/22/20237798
3 REPLIES 3
Anonymous
Not applicable

Hi @Khalefa ,

 

You may create a following measure. The calculation logic is to get the forecast values of the current week and the previous week according to the week version, respectively, and then get the percentage.

 

WOW =
VAR _CUR =
    CALCULATE (
        SUM ( 'Table'[Forecast] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            [Week version] = MAX ( 'Table'[Week version] )
                && [Week] = MAX ( 'Table'[Week] )
        )
    )
VAR _PRE =
    CALCULATE (
        SUM ( 'Table'[Forecast] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            [Week version] = MAX ( 'Table'[Week version] )
                && VALUE ( RIGHT ( [Week], LEN ( [Week] ) - 1 ) )
                    = VALUE ( RIGHT ( MAX ( 'Table'[Week] ), LEN ( MAX ( 'Table'[Week] ) ) - 1 ) ) - 1
        )
    )
RETURN
    DIVIDE ( _CUR - _PRE, _PRE )

 

vstephenmsft_0-1670486106344.png

 

 

 

 

Best Regards,

Stephen Tao

 

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

Thanks @Anonymous for the support

i still need to calculate the change% for a specific week in all week versions ( trendline)

 

by other means, if week 46 repeats in 3 versions ( v-43 , V-44, V-45,V-46 ) i need to know the change rate trend line :

- (Week 46 in V-44  -  Week 46 in V-43 ) / Week 46 in V-43 

-Then  (Week 46 in V-45  -  Week 46 in V-44 ) / Week 46 in V-44  etc. 

Khalefa
Helper I
Helper I

 Sorry the sample some how corrupted when I added the tables. If it is clear.  Let me know 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.