Forum Discussion
Dynamic slicer increase percentage
- 2 years ago
Create a What-if parameter name it Salary Increase Percentage and set the minimum to 0 and maximum to 1 (or 100 if you want to work in percentage rather than decimal).
You can then create a measure like below :
Future Salary = VAR SelectedPercentage = SELECTEDVALUE('Salary Increase Percentage'[Value]) VAR CurrentSalary = SUM('Employee'[Employee Current Salary]) RETURN IF ( NOT ISBLANK(SelectedPercentage) && NOT ISBLANK(CurrentSalary), CurrentSalary * (1 + SelectedPercentage) )
and another one to display if the selected percentage is within the employee's allowable range:Allowable Increase = VAR SelectedPercentage = SELECTEDVALUE('Salary Increase Percentage'[Value]) VAR MinPercentage = MIN('Employee'[Employee Salary Increase Minimum Proposal %]) VAR MaxPercentage = MAX('Employee'[Employee Salary Increase Maximum Proposal %]) RETURN IF ( SelectedPercentage >= MinPercentage && SelectedPercentage <= MaxPercentage, "Yes", "No" )
Hi Brian415_ ,
AmiraBedh 's reply is a good idea. Great!
Slicers with dynamic minimum maximums don't seem to be achievable. But you can create a dynamic percentage slicer and decide whether to return results based on the percentage range of employees.
Then I improved it a bit and attached a .pbix file for reference.
Here's the solution. You can create a what-if paramenters.
When created is clicked, a slicer will be generated.
Then create a measure to claculate the future salary.
Future Salary = var _sel=[Employee Salary Increase Proposal Range Value]
return IF(_sel>=[Employee Salary Increase Minimum Proposal %]&&_sel<=[Employee Salary Increase Maximum Proposal %],(1+_sel)*SUM('Table'[Employee Current Salary]))
If the percentage in the slicer exceeds an employee's maximum increase percentage, the employee's future salary does not return results.
Hope that helps.
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.