Forum Discussion
How to Implement User-Defined Input Parameter for Target Processing Time in Power BI direct query
- 2 years ago
Hi Rockz
To create an unlinked slicer go Modeling -> Numeric range:
Enter the min and max days they can choose, I've called my new column Day Slider:
This createds a table with a measure capturing what is chosen in the slider.
Create a new measure referencing that measure (right click the table and choose new measure:
TargetValue =[Day Slider Value] * 8.5 * 60 (minutes)
If you don't have the ProcessingTime column in your data it would be:
Processing Time =var daysdiff = --Number of days between start and end multiplied by minutes out of hoursDATEDIFF('Open Closed'[ Issue Created Date ], [ Close Date ],DAY) *960var minsdiff = --minutes between dates less out of hours minutesDATEDIFF('Open Closed'[ Issue Created Date ], [ Close Date ],MINUTE) - daysdiffreturnif(WEEKNUM([ Issue Created Date ]) <> WEEKNUM([ Close Date ]) --if they are in the same week,minsdiff --returns calculated minutes,minsdiff + (WEEKNUM([ Close Date ]) - WEEKNUM([ Issue Created Date ])) * 3840) --if in different weeks, work out how many weeks and subtract a weekends worth of minutesThen make a measure:
TotalProcessingTime = SUM(Table[Processing Time])Finish with your final measure:
AchieveTarget = IF([TotalProcessingTime] <= [TargetValue], "Achieve", "Not Achieve")If this works please mark as a solution for others to find 🙂
Hi Rockz
To create an unlinked slicer go Modeling -> Numeric range:
Enter the min and max days they can choose, I've called my new column Day Slider:
This createds a table with a measure capturing what is chosen in the slider.
Create a new measure referencing that measure (right click the table and choose new measure:
TargetValue =[Day Slider Value] * 8.5 * 60 (minutes)
If you don't have the ProcessingTime column in your data it would be:
TotalProcessingTime = SUM(Table[Processing Time])
AchieveTarget = IF([TotalProcessingTime] <= [TargetValue], "Achieve", "Not Achieve")