Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello Everyone
first of all this is a sample for the expected answer but manually
| اسلام احمد منصور احمد 1 | اسلام احمد منصور احمد 2 | ||
| 30/06/2014 | assignment wage | 275 | |
| 02/08/2014 | assignment wage | 700 | |
| 30/06/2015 | post exceptional add wage | 288.75 | 735 |
| 01/07/2015 | post regular add wage | 353.75 | 735 |
| 01/07/2016 | post regular add wage | 418.75 | 800 |
| 01/07/2017 | post regular add wage | 493.75 | 912 |
| 28/07/2017 | post exceptional add wage | 518.4375 | 957.6 |
| 01/07/2018 | post regular add wage | 593.4375 | 1032.6 |
| 30/06/2019 | post encouragement and promotion wage | 688.109375 | 1135.86 |
| 01/07/2019 | post regular add wage | 763.109375 | 1215.3702 |
| 30/06/2020 | post encouragement and promotion wage | 876.2648438 | 1336.90722 |
| 01/07/2020 | post regular add wage | 941.2648438 | 1430.490725 |
I'm trying to build HR project and I’m going to get to subject directly
For the date calculated column (PreviousRegAddDate) I wanna do the following
For the base wage calculated column (RegAddBaseWage) I wanna do the following :
Now the most interesting part which is third calculated column (ModifiedWageAfterAddingRegularAdd ) instead of a measure coz it’s easier like this to me to explain we can make it as follows:
That’s it for the first decision type of my project if there is any mysterious points within my explanation just tell me
i'm gonna use power pivot and power query in excel and VBA for forms and reports printing part
Thx to everyone in advance
I’ll attach the sample pbix file
Hi @Islam ,
By what you said in Step2,column PreviousRegAddDate.you said you wanna check the corresponding EmpID value,how to check it?Be equal to the value which is filtered in RegdecCodeNum?
For column RegAddBaseWage ,you said:
What do you mean by the previous value,is it from dtblBasicEmpInfo table?
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
ok sir for the first question you asked about step 2 this one
what i meant here is that i wanna once we find a value in RegDecCodeNum to store the corresponding EmpID in current row in a variable so we can use it as a criteria to filter the FTransactions2 table to get only previous rows not next row
For question two about that step
i mean the base wage for that particular column that will calculate all wage raises based on is going to be the base wage in dtblBasicEmpInfo Table i mean if there is no previous regular adds for the filtered EmpID then we bring the wage from dtblBasicEmpInfo table or else get the previous calculated wage after adding the previous regular add after taking all criterias in this step in consideration of course
you can check the table in the post with the expected answer for each employee and you will get it i think
Hi @Islam ,
I do appreciate your patience so far,but it may cost me some more time to figure it out,I will be back to you once I get a result.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
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!
Ok sir I'll check it asap and inform of result
I'll send you a private message
Please read and follow the recommendations in this thread:
How to get your question answered quickly
Proud to be a Super User!
Paul on Linkedin.
what i understood from this guiding article is that i have to post a manual answer or solution for my problem so everyone take it as a guidance through his help on this
i attached a pbix file and i can share a simple table showing the manual answer of my question
Hi @Islam ,
Could you pls summarize your requirements by showing the raw data with expected output?It is too complicated...
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
check it now sir i modified the post
unfortunately i tried to simplify what i need as much i could but as a general idea it's a full HR system using Excel power pivot and power query and VBA for excel and could use SSMS
can i have a private voice conversation with you sir to explain further and then you will post what we conclude here in the post as your solution
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |