Forum Discussion
Filtered Table
Your code gave me the prodding I needed to work out the solution.
Here's the code that actually works:
Est Annual Wages =VAR _lastChangetbl = FILTER(ALLSELECTED('tblSalaryModifications'),'tblSalaryModifications'[DtAssigned] = MAX('tblSalaryModifications'[DtAssigned] ))VAR _salary = SUMX( _lastChangetbl, [Salary])VAR _annualHourly = SUMX( _lastChangetbl, [HourlyRate] * [HoursPerWeek] ) * 52RETURNIF(_salary > 0,_salary,_annualHourly)
2 Replies
- amitchandakSuper User
newhopepdx , Follow the code of lastest given here
Last Qty = Var _max = maxx(filter( ALLSELECTED('tblSalaryModifications'), 'tblSalaryModifications'[EMPID] = max('tblSalaryModifications'[EMPID] )), 'tblSalaryModifications'[DtAssigned])
return
CALCULATE(sumx('tblSalaryModifications',[HoursPerWeek] *[HourlyRate] * 52 ), filter( ('tblSalaryModifications'), 'tblSalaryModifications'[EMPID] = max('tblSalaryModifications'[EMPID]) && 'tblSalaryModifications'[Date] =_max))
Sum Last Qty = sumx(VALUES('tblSalaryModifications'[EMPID]) , [Last Qty])Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0- newhopepdxResolver I
Your code gave me the prodding I needed to work out the solution.
Here's the code that actually works:
Est Annual Wages =VAR _lastChangetbl = FILTER(ALLSELECTED('tblSalaryModifications'),'tblSalaryModifications'[DtAssigned] = MAX('tblSalaryModifications'[DtAssigned] ))VAR _salary = SUMX( _lastChangetbl, [Salary])VAR _annualHourly = SUMX( _lastChangetbl, [HourlyRate] * [HoursPerWeek] ) * 52RETURNIF(_salary > 0,_salary,_annualHourly)