The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Year | Employees | What if calculation result |
2020 | 1000 | 950 |
2021 | 1000 | 900 |
2022 | 1000 | 850 |
2023 | 950 | 760 |
2024 | 950 | 712,5 |
Very thankful for any help!
Solved! Go to Solution.
@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)
@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.
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |