Forum Discussion
Jason_Walker
2 years agoFrequent Visitor
How to Create a Static Value from Most Recent Payroll Date?
I'm working to create a measure that will look up the latest payroll date, sum the cost data for that date, calculate a daily cost, and then project future payroll costs based on the daily rate and the # of work days in each month. So far my measure works correctly for months equal to or earlier than the last payroll date but leaves blanks for future months. I believe the problem is the last payroll date is acting as a filter so future months are excluded from the calculations.
Here is the measure to calculate the net amount paid for the last pay period (also removes any one time payroll costs):
Net Amount Paid =
var maxDate = MAX('df_Last_PPE_Input'[Pay Period End Date])
var ONETIME_Amount = CALCULATE(SUM(df_Last_PPE_Input[AMOUNT PAID (DETAIL)]), 'df_Last_PPE_Input'[ONETIME] = "Yes", 'df_Last_PPE_Input'[Pay Period End Date] = maxDate
)
RETURN
[Amount Paid Last PPE]- ONETIME_Amount
This is the measure to calculate the daily payroll cost:
Daily Rate = [Net Amount Paid] / 10
And finally the measure to calculate future payroll costs:
*[FY24 NETWORKDAYS] is a calculated column that calculates the net work days for each month*
Projected Payroll =
var proj = CALCULATE('All Measures'[Daily Rate] * SUM('df_dim_Fiscal_Month'[FY24 NETWORKDAYS]))
RETURN
proj
This is the end result
Any idea why future months are being excluded from the results?
2 Replies
- Greg_DecklerCommunity Champion
Jason_Walker Can you post some example/sample source data?
- Jason_WalkerFrequent Visitor