Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
hello Everyone
this is a sample file for what i need and i explained every thing in a text box in the file and i need help
and to summerize what i need exactly is that i have two date in two different tables and an initiate value in the fact table which has relationships with both other tables and i wanna based on camparing the two dates in the two tables to generate the new value based on result of dates comparison and extracted from the initiate value in the fact table
and here is the sample file
https://drive.google.com/file/d/1jlbkikkQfscIu4BO1bx3TnvAKMeORW3B/view?usp=sharing
"the initial wage or base wage which i enter manually for each employee"
How are you planning to do that in Power BI?
Can I contact you privately sir ?
I've no ideabut I decided to put each employee base wage in employee basic details table and then calculate each raise by it's value percentage
Hi @Islam ,
Based on my understanding, I compare the Decision Apply Date with the DecImpDate. And wages increase at a rate of 50% per year. If this is not the output you expect, please describe it in more detail.
NewWage =
var DateDiff =
DATEDIFF(
MAX(dtblassignmentDec[Decision Apply Date]),
MAX(dtblRegularAdds[DecImpDate]),
YEAR
)
return
MAX(FTransactions1[Wage]) * POWER( 1.5, DateDiff )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'll mention you in the more explained post
Hi @Islam ,
Try the following formula:
Wage growth =
VAR MinDate =
MINX (
ALLSELECTED ( dtblassignmentDec[Decision Apply Date] ),
dtblassignmentDec[Decision Apply Date]
)
VAR currentyear =
YEAR ( MAX ( dtblRegularAdds[DecImpDate] ) )
var YearDiff =
currentyear - YEAR(MinDate)
var _year =
IF(
MAX(dtblRegularAdds[DecImpDate]) >= EDATE(MinDate,YearDiff*12),
YearDiff,
YearDiff-1
)
VAR growthRate =
SUM(dtblRegularAdds[PromotionRate])
VAR Result =
SUM ( dtblBasicEmpInfo[Wage] ) * ( 1 + growthRate ) ^ _year
RETURN
Result
This is my PBIX file.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
it's almost correct but unfortunately both employees got the regular add although one of them has a date differnce between his assigning date and regular add date equals to less than a year
like following picture
sure sir I'll inforn you with result and sry for sending you the explaination privately because I couldn't type it here due to site html restrictions
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |