Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Community,
I want to allow the report end user to provide input based on which a measure is calculated.
Report looks like following:
The user can select Empcode from parameterized slicer 'Emp'. I would like to have another parametrized slicer to get user input for 'Number of Leaves taken' (a numeric value 1 to 20) by the corresponding Empcode selected in slicer 'Emp'. Then I want to create a measure:
Hours Worked = Hrs per week - Number of leaves taken.
How can I achieve this?
My Pbi file: https://1drv.ms/u/s!Ag919_pO_UKrgRFm2OqHum4jDUhC?e=hDpXyw
TIA
Solved! Go to Solution.
Hi @Anonymous ,
According to my understanding, the [Number of Leaves taken] is a what-if parameter as well,right?
To my knowledge,when you create a what-if parameter, a measure is automatically generated.So you could use it directly like this:
Hours Worked =
VAR hrsPerWeek =
CALCULATE (
SUM ( Emp[Hrs per week] ),
FILTER ( 'Emp', 'Emp'[Emp Code] = SELECTEDVALUE ( Emp[Emp Code] ) )
)
RETURN
hrsPerWeek -[Number of Leaves taken Value]
The final output is shown below:
Here is the pbix file.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to my understanding, the [Number of Leaves taken] is a what-if parameter as well,right?
To my knowledge,when you create a what-if parameter, a measure is automatically generated.So you could use it directly like this:
Hours Worked =
VAR hrsPerWeek =
CALCULATE (
SUM ( Emp[Hrs per week] ),
FILTER ( 'Emp', 'Emp'[Emp Code] = SELECTEDVALUE ( Emp[Emp Code] ) )
)
RETURN
hrsPerWeek -[Number of Leaves taken Value]
The final output is shown below:
Here is the pbix file.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , You can try What if parameters
@amitchandak yes, I have tried 'What if parameter'. The 'Emp' slicer is a what is parameter.
@Anonymous , No of leaves can be what if. Emp Code, You might use Text filter https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104381309?src=office&tab=Overview
@amitchandak I can't make the text filter work in this case. 'The issue is I can't establish relationshi between my table & 'No: of leaves' what if parameter. No: of leaves' is just a numeric input value corresponding to an Empcode that I want to use in the measure calculation.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.