Forum Discussion

Brian415_'s avatar
Brian415_
Frequent Visitor
2 years ago
Solved

Dynamic slicer increase percentage

I have a dataset in Power BI.   This dataset has data on: Employee Name (Column) Employee Seniority (Column) Employee Current Salary (Column) Employee Salary Increase Minimum Proposal % (Measu...
  • AmiraBedh's avatar
    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"
    )