Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Forecast per Company distributed yearly

Hello Experts,

 

I have a revenue data for each company distributed from 2017 to 2030. I want to calculate forecast from the selected year until the last year, that is 2030. Data seems like following.

CompanyYearRevenure
A201765
A201869
A201976
A202073
A202178
A202282
A202394
A2024108
A2025125
A2026143
A2027165
A2028190
A2029218
A2030251
B201738
B201845
B201950
B202047
B202156
B202262
B202372
B202482
B202595
B2026109
B2027125
B2028144
B2029166
B2030190
C201710
C201810
C201911
C202011
C202112
C202213
C202315
C202417
C202519
C202622
C202726
C202830
C202934
C203039

 

I want to have it in table as below

if is it possible if i select year 2022 and the table will show numbers from 2022 and onwards instead of 2017?

 20172018
Company RevenueForecast RevenueForecast 
A    
B    
C    
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, Anonymous 

    You can create a new measure, try the following DAX expression:

     

    Forecast = 
    VAR LastYear = MAX('Table'[Year])
    VAR GrowthRate = 0.07 -- Adjust this based on your data
    RETURN
    SUMX(
        FILTER(
            'Table',
            'Table'[Year] >= LastYear
        ),
        'Table'[Revenue] * (1 + GrowthRate)
    )
    

     

     

    If you want to select 2022, the table will show numbers for 2022 and beyond instead of 2017, you can create a new table

     

    Table 2 = VALUES('Table'[Year])

     

    Then create a new measure:

     

    Revenure measure = 
    VAR _Slicer = MAX('Table 2'[Year])
    RETURN 
    IF(MAX('Table'[Year])<_Slicer,BLANK(),SUM('Table'[Revenure]))

     

    Put revenure measure and Forevast in matrix view, and put table 2 [year] in slicer view:

     

    Here is my preview:

     

    How to Get Your Question Answered Quickly

    Best Regards

    Yongkang Hua

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

3 Replies

  • Hello Anonymous,

     

    Can you please try the following approach:

    Forecast Revenue = 
    VAR SelectedYear = SELECTEDVALUE('YourTable'[Year])
    RETURN
    IF(
        MAX('YourTable'[Year]) >= SelectedYear,
        CALCULATE(
            SUM('YourTable'[Revenue]),
            FILTER(
                'YourTable',
                'YourTable'[Year] >= SelectedYear
            )
        ),
        BLANK()
    )
    

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Sahir_Maharaj 

      Thank you for your solution. 


      I was thinking how can I calculate an increase of 7 % from a selected year. If I select 2021 as a base year and then 2022 onwards 2030 will show increase of 7%  per year on revenue of the last year. Example 2022 shows 7% increase on 2021 and 2023 shows 7% increase of 2022.


      Another scenario, Is there any way if I can set % on my own except 7% and it will be calculated from the selected year as mentioned in scenario above.

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, Anonymous 

    You can create a new measure, try the following DAX expression:

     

    Forecast = 
    VAR LastYear = MAX('Table'[Year])
    VAR GrowthRate = 0.07 -- Adjust this based on your data
    RETURN
    SUMX(
        FILTER(
            'Table',
            'Table'[Year] >= LastYear
        ),
        'Table'[Revenue] * (1 + GrowthRate)
    )
    

     

     

    If you want to select 2022, the table will show numbers for 2022 and beyond instead of 2017, you can create a new table

     

    Table 2 = VALUES('Table'[Year])

     

    Then create a new measure:

     

    Revenure measure = 
    VAR _Slicer = MAX('Table 2'[Year])
    RETURN 
    IF(MAX('Table'[Year])<_Slicer,BLANK(),SUM('Table'[Revenure]))

     

    Put revenure measure and Forevast in matrix view, and put table 2 [year] in slicer view:

     

    Here is my preview:

     

    How to Get Your Question Answered Quickly

    Best Regards

    Yongkang Hua

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