Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

What if parameter increased per year

Hi,

Im trying to create a What if parameter for end user to select "attrition rate" for example user would select 5% per year.
Then in my "Line and stacked column chart" i would have x axis as date and y axis as number of employees.

My end goal is then to have a line showing number of employees with 5% loss per year cumulative.


Outcome example

YearEmployeesWhat if calculation result
20201000950
20211000900
20221000850
2023950760
2024950712,5


Very thankful for any help!

  • Anonymous ,

     

    You need to create this measure:

     

    _Accumulate = SUM('Table'[Employees]) - ((RANKX(ALL('Table'[Year]), CALCULATE(MIN('Table'[Year])),, ASC) * Parameter[Parameter Value]) * SUM('Table'[Employees]) / 100)

     

     

     

    Check the attached file.

2 Replies

  • camargos88's avatar
    camargos88
    Icon for Community Champion rankCommunity Champion

    Anonymous ,

     

    You need to create this measure:

     

    _Accumulate = SUM('Table'[Employees]) - ((RANKX(ALL('Table'[Year]), CALCULATE(MIN('Table'[Year])),, ASC) * Parameter[Parameter Value]) * SUM('Table'[Employees]) / 100)

     

     

     

    Check the attached file.

  • Anonymous , Try a measure like

    measure  =
    var _min = minx(allselected(Table), Table[Year])
    var _sel = selectedvalue(Slicer[slicer]) //what if value 
    return 
    calculate( sum(Table[Employees]) -  (((max(Table[Year]) -_min)+1) * _sel * sum(Table[Employees]))/100)