Forum Discussion
Many Criterias Calculated columns
ok sir take your time i'll be waiting
Hi Islam ,
Sorry for the late reply.
Per your request,I create a measure to get the result of "PreviousRegAddDate",I'm not sure whether I have understood correctly.
If RegDecCodeNum has a value,then check the corresponding EmpID value,here I get a result as below:
Now you need the previous value of each EmpID,which should be as below:
Then get the nearest RegDecCodeNum ID which is 1,and link the ID in dtblRegularAdds to get the DecImpDate,which is 2015/7/1,for the blank rows,use "Decision Apply Date" value instead.
If so,use below dax expression:
Measure =
var _tab=CALCULATETABLE(VALUES('FTransactions2'[EmpID]),FILTER(ALL(FTransactions2),'FTransactions2'[RegDecCodeNum]<>BLANK()))
var _previousID=CALCULATE(MAX('FTransactions2'[EmpID]),FILTER(ALL('FTransactions2'),'FTransactions2'[EmpID]<MAX('FTransactions2'[EmpID])&&'FTransactions2'[EmpID] in _tab))
var _closestcode=CALCULATE(MIN('FTransactions2'[RegDecCodeNum]),FILTER(ALL('FTransactions2'),'FTransactions2'[RegDecCodeNum]>=_previousID))
Return
IF(ISBLANK(MAX('FTransactions2'[RegDecCodeNum])),BLANK(),
IF(_previousID=BLANK(),MAX('dtblassignmentDec'[Decision Apply Date]),
CALCULATE(MAX('dtblRegularAdds'[DecImpDate]),FILTER('dtblRegularAdds',VALUE('dtblRegularAdds'[RegDecCodeNum])=_closestcode))))
And you will see:
If I miss something,pls correct me.
If it's what you need,let me know,I would provide the dax expression for the other 2 columns.
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
- Islam5 years ago
Helper V
Ok sir I'll check it asap and inform of result
I'll send you a private message